This file contains 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
https://wordpress.org/support/topic/conditional-statement-is-page-a-grandchild?replies=6 | |
http://wordpress.stackexchange.com/questions/182017/a-check-for-if-is-parent-page-if-has-children-if-has-grandchildren | |
<?php if( count(get_post_ancestors($post->ID)) == 2 ) echo 'this is grandchild of top page'; ?> | |
<?php if( count(get_post_ancestors($post->ID)) >= 2 ) echo 'this is grandchild of some page'; ?> | |
try and echo the post id before the code to see if it is the one of the page you are on: | |
maybe also add a is_page() conditional: | |
<?php |
This file contains 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
//https://codex.wordpress.org/Function_Reference/remove_menu_page | |
<?php | |
function remove_menus(){ | |
remove_menu_page( 'index.php' ); //Dashboard | |
remove_menu_page( 'jetpack' ); //Jetpack* | |
remove_menu_page( 'edit.php' ); //Posts | |
remove_menu_page( 'upload.php' ); //Media | |
remove_menu_page( 'edit.php?post_type=page' ); //Pages |
This file contains 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
foreach ( array( 'pre_term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_filter_kses' ); | |
} | |
foreach ( array( 'term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_kses_data' ); | |
} |
This file contains 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 | |
function removebadsticky_woocommerce_scripts() { | |
wp_deregister_script( 'storefront-sticky-payment'); | |
} | |
add_action( 'wp_enqueue_scripts', 'removebadsticky_woocommerce_scripts' , 90 ); | |
?> |
This file contains 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 | |
function append_language_class($classes){ | |
$classes[] = ICL_LANGUAGE_CODE; //or however you want to name your class based on the language code | |
return $classes; | |
} | |
add_filter('body_class', 'append_language_class'); | |
?> |
This file contains 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 | |
function parent_theme_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'parent_theme_enqueue_styles' ); | |
?> |
This file contains 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
/* Right way */ | |
<?php the_title( '<h1>', '</h1>' ); ?> | |
/* Wrong way */ | |
<h1> <?php the_title(); ?> </h1> |
This file contains 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
Movable Type has never been Free Software, as defined by the Free Software | |
Foundation. It has never been open source software, as defined by the Open | |
Source Initiative. Six Apart survived and thrived in the blogging community | |
because Movable Type was “free enough.” | |
… | |
Many people misunderstand | |
Free Software and the GNU General Public License. Many people equate the GPL to | |
the boogeyman, because it’s “viral”, and that sounds like a bad thing. |
This file contains 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 | |
function yourownprefix_excerpt_length($length) { | |
global $post; | |
if ($post->post_type == 'post') | |
return 32; | |
else if ($post->post_type == 'products') | |
return 65; | |
else if ($post->post_type == 'testimonial') | |
return 75; |