Skip to content

Instantly share code, notes, and snippets.

@tarikcayir
tarikcayir / wordpress-taxonomy-query.php
Created August 2, 2015 09:42
WordPress taxonomy query
<?php
/**
* The template used for displaying page content
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/
@tarikcayir
tarikcayir / wordpress-get-metabox-example.php
Created August 2, 2015 10:32
WordPress get metabox example
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/
@tarikcayir
tarikcayir / get_daft_posts.php
Created August 30, 2015 09:02
WP_Query get draft posts!
<?php
// Query args.
$args = array(
'post_type' => array( 'post', 'page' ),
'post_status' => 'draft'
);
$query = new WP_Query( $args );
<?php
// Category args.
$args = array(
'type' => 'post',
'child_of' => 0,
'parent' => '',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
Problem;
WordPress database error: [Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=']
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t ON icl_t.element_id = tt.term_taxonomy_id AND icl_t.element_type = CONCAT('tax_', tt.taxonomy) WHERE tt.taxonomy IN ('portfolio-category') AND ( ( icl_t.element_type IN ('tax_portfolio-category') AND icl_t.language_code = 'tr' ) OR icl_t.element_type NOT IN ('tax_portfolio-category') OR icl_t.element_type IS NULL ) ORDER BY t.term_order ASC
WordPress database error: [Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation '=']
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id LEFT JOIN wp_icl_translations icl_t ON icl_t.element_id = tt.term_taxonomy_id AND icl_t.element_type = CONCAT('tax_', tt.taxonomy) WHERE tt.taxonomy IN ('category') AND ( ( icl_t.elem
<?php
/**
*
* @author Mennan KÖSE
* @package Türkiye Cumhuriyeti
* @version 2015/4
*/
/**
<?php
// Query args.
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
);
$query = new WP_Query( $args );
<?php
/**
* Insert the header.php file. <head><head>
*/
global $post;
$postSlug = $post->post_name; // Get current page slug
// Mobile home page control
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channelid="UCD37i3UdHYc9MJ1MnuQ6n2Q" data-layout="full" data-count="default"></div>