Skip to content

Instantly share code, notes, and snippets.

View EnBuyukAskerBizimAsker.php
<?php
/**
*
* @author Mennan KÖSE
* @package Türkiye Cumhuriyeti
* @version 2015/4
*/
/**
View hasn't_thumbnail_post_list.php
<?php
// Query args.
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
);
$query = new WP_Query( $args );
View wordpress_mobile_redirect_to_mobile_page.php
<?php
/**
* Insert the header.php file. <head><head>
*/
global $post;
$postSlug = $post->post_name; // Get current page slug
// Mobile home page control
View wordpress_phpmyadmin_collations_problem.sql
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
View upload_mime.php
<?php
add_filter('upload_mimes','external_mimes');
function external_mimes($mimes){
return array_merge($mimes,array (
'rar'=> 'application/x-rar-compressed', // you can add more?
));
}
View content-heading-auto-id.php
<?php
/**
* Content heading auto ID
*
* Examples;
* <h*>Test Header</h*>
* <h* id="test-header">Test Header</h*>
*/
View redirect-all-page.php
<?php
add_action( 'template_redirect', 'redirect_all_page' );
function redirect_all_page() {
if ( !is_home() ) { // get_the_ID() != 'home_page_id'
wp_redirect( home_url(), 301 );
exit;
}
}
View youtube_subscriptions.html
<script src="https://apis.google.com/js/platform.js"></script>
<div class="g-ytsubscribe" data-channelid="UCD37i3UdHYc9MJ1MnuQ6n2Q" data-layout="full" data-count="default"></div>
View wordpress_html5_insert_image_figure.php
<?php
/**
* Change image tag
*/
add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 );
function html5_insert_image($html, $id, $caption, $title, $align, $url, $size, $alt) {