This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add new image sizes to media editor | |
function media_custom_image_sizes( $image_sizes ) { | |
// get the custom image sizes | |
global $_wp_additional_image_sizes; | |
// if there are none, just return the built-in sizes | |
if ( empty( $_wp_additional_image_sizes ) ) | |
return $image_sizes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*================================================== | |
= Bootstrap 3 Media Queries = | |
==================================================*/ | |
/*========== Mobile First Method ==========*/ | |
/* Custom, iPhone Retina */ | |
@media only screen and (min-width : 320px) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* custom admin columns for custom-post-type , and sorting | |
* | |
* custom_post_type: enter cutom post type as function name | |
* custom-post-type: enter your custom post here | |
* custom_column: enter your custom colum id | |
* custom_column1: enter your custom colum id | |
* CustomColumnName: enter your custom column name | |
* custom_meta: enter custom meta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Define the function for customize archive page | |
function your_taxonomy_archive_customization ( $query ) { | |
if (($query->is_main_query()) && (is_tax('your_custon_taxonomy'))) { | |
$query->set( 'posts_per_page', '3' ); | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* list taxonomy accoeding to the custom post type | |
* @var [string] | |
* ref: http://codex.wordpress.org/Template_Tags/wp_list_categories | |
*/ | |
$custom_taxonomy = get_object_taxonomies('taxonomy-slud-or-id'); | |
if(count($custom_taxonomy) > 0): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($post->post_parent) : | |
$ancestors = get_post_ancestors($post->ID); //get all parent post ids in an array | |
$root = count($ancestors)-1; //find the count | |
$parent = $ancestors[$root]; //get top parent id | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add www.infront of urls | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^([^.]+\.[a-z]{2,6})$ [NC] | |
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Wordpress general query | |
* http://codex.wordpress.org/Class_Reference/WP_Query | |
* */ | |
// WP_Query arguments | |
$custom_args = array ( 'post_type' => 'custom_post', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => '5', 'order' => 'DESC', 'orderby' => 'date', ); | |
// The Query | |
$custom_query = new WP_Query( $custom_args ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ======== acf option page customization ======== | |
* @param [type] $settings | |
* @return [type] | |
*/ | |
function my_acf_options_page_settings( $settings ) | |
{ | |
$settings['title'] = 'Page Title'; | |
$settings['menu'] = 'Menu Title'; |