Skip to content

Instantly share code, notes, and snippets.

@FSahinn
FSahinn / functions.php
Created July 26, 2018 10:43
Kategoriyi başlığa göre sıralama
// Kod ?>'ın hemen üstüne eklenecek.
function foo_modify_query_order( $query ) {
if ( $query->is_category() && $query->is_main_query() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
}
add_action( 'pre_get_posts', 'foo_modify_query_order' );
/*
$tUp: Beğenenler
$tDown: Beğenmeyenler
$tTotal: Beğenen ve Beğenmeyenler Toplamı
$percentageCalculate: Beğenenlerin yüzde hesaplaması. Ör: % 75 Kişi Beğenmiş
*/
$tUp = 50;
$tDown = 90;
$tTotal= $tUp + $tDown;
$percentageCalculate = ($tUp*100) / $tTotal;
@FSahinn
FSahinn / Frontend Edit Profile Page Wordpress
Created February 7, 2017 18:39 — forked from azizultex/Frontend Edit Profile Page Wordpress
Frontend Edit Profile Page Wordpress
<?php
/*
Template Name: Frontend Edit Profile
*/
get_header();
if ( is_user_logged_in() ) : {
$user_ID = get_current_user_id();
$user_info = get_userdata($user_ID);
@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');
@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 / 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 / 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 / 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>
/*
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