Skip to content

Instantly share code, notes, and snippets.

@FSahinn
FSahinn / eddkisakod.php
Last active December 3, 2015 18:45
Easy digital download için gerekli kısa kodlar
<?php echo edd_get_cart_quantity(); ?> // Sepetekki ürün sayısı
<?php echo edd_get_cart_total(); ?> // Sepetteki toplam fiyat
<?php echo edd_get_checkout_uri(); ?> // Sepete yönlendiren kod
<?php edd_price($post->ID); ?> // Ürünün fiyatı
Functions.php'ye eklenecek kodlar
// Download uzantısını kendi uzantınız ile değiştirmek
define('EDD_SLUG', 'uzantiadi');
wp_embed_register_handler( 'gist', '/https?:\/\/gist\.github\.com\/([a-z0-9]+)(\?file=.*)?/i', 'fshn_gist_embed' );
function fshn_gist_embed( $matches, $attr, $url, $rawattr ) {
$embed = sprintf(
'<script src="https://gist.github.com/%1$s.js%2$s"></script>',
esc_attr($matches[1]),
esc_attr($matches[2])
);
@FSahinn
FSahinn / Infınıte Scroll Yapma
Created November 30, 2016 08:05
Wordpress için infinite scroll
// index.php'ye eklenecek kod
<div id="infinite-scroll-wrap">
<?php next_posts_link('Sonraki sayfa'); ?>
</div>
// JS'ye eklenecek fonksiyon
jQuery(document).ready(function() {
jQuery('#icerik .sagalan').infinitescroll({ // yazıların bulunduğu class ya da id
navSelector : "#infinite-scroll-wrap", // Seçicinin bulunduğu id
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50505
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50505
@FSahinn
FSahinn / login_register_reset.php
Created December 26, 2016 19:13
Custom Register/Reset/Login Wordpress
<!-- Custom Login/Register/Password Code @ http://digwp.com/2010/12/login-register-password-code/ -->
<!-- Theme Template Code -->
<div id="login-register-password">
<?php global $user_ID, $user_identity; get_currentuserinfo(); if (!$user_ID) { ?>
<ul class="tabs_login">
<li class="active_login"><a href="#tab1_login">Login</a></li>
<li><a href="#tab2_login">Register</a></li>
@FSahinn
FSahinn / login_register_reset.php
Created December 26, 2016 19:13
Custom Register/Reset/Login Wordpress
<!-- Custom Login/Register/Password Code @ http://digwp.com/2010/12/login-register-password-code/ -->
<!-- Theme Template Code -->
<div id="login-register-password">
<?php global $user_ID, $user_identity; get_currentuserinfo(); if (!$user_ID) { ?>
<ul class="tabs_login">
<li class="active_login"><a href="#tab1_login">Login</a></li>
<li><a href="#tab2_login">Register</a></li>
@FSahinn
FSahinn / form_registo_wp.php
Created December 26, 2016 19:17 — forked from miukimiu/form_registo_wp.php
This a register form to wordpress
<?php
/*
** Template Name: Registo
** Este template foi criado pela miukimiu.com
** É um formulário de regsto costumizado para um site wordpress.
*/
get_header(); ?>
<div class="block-9 no-mar content-with-sidebar">
@FSahinn
FSahinn / ajax-registration.js
Created December 26, 2016 19:19 — forked from Aziz-Rahman/ajax-registration.js
Register user with ajax (WP)
jQuery(document).ready(function($) {
/**
* When user clicks on button...
*
*/
$('#btn-new-user').on("click",function() {
/**
* Prevent default action, so when user clicks button he doesn't navigate away from page
@FSahinn
FSahinn / gist:a240197d6eba70dad8971e3227a9b4d8
Created January 20, 2017 11:48 — forked from ebinnion/gist:4601825
WordPress Top Commenters Code
function top_comment_authors($amount = 5){
global $wpdb;
$results = $wpdb->get_results('
SELECT
COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url
FROM
'.$wpdb->comments.'
WHERE
@FSahinn
FSahinn / gist:c5ba33e5b3589b9952cfbf86ade14c00
Created February 4, 2017 10:16
Wordpress Arama Sonucunda Sadece Yazılar Çıksın
/* Arama Filtresi (4Piksel) */
function dpx_aramafiltre($query) {
if ($query->is_search) {
$query->set('post_type', 'post'); /* Buraya arama sonuçlarında çıkmasını istediğiniz yazı türünü yazabilirsiniz. Örnek: page ya da kendi yazı türünüz. */
}
return $query;
}
add_filter('pre_get_posts','dpx_aramafiltre');