Skip to content

Instantly share code, notes, and snippets.

@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);
/*
$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 / 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' );