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 my_theme_add_editor_styles() { | |
add_editor_style( 'custom-editor-style.css' ); | |
} | |
add_action( 'after_setup_theme', 'my_theme_add_editor_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
<?php add_editor_style( $stylesheet ); ?> |
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
// Callback function to filter the MCE settings | |
function my_mce_before_init_insert_formats( $init_array ) { | |
// Define the style_formats array | |
$style_formats = array( | |
// Each array child is a format with it's own settings | |
array( | |
'title' => '.translation', | |
'block' => 'blockquote', | |
'classes' => 'translation', | |
'wrapper' => true, |
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 my_function() { | |
// contents of function go here | |
} | |
add_action( 'pre_get_posts', 'my_function'); | |
?> |
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 my_function() { | |
if ( is_home() && $query->is_main_query() ) { | |
$query->set( 'post_type', array( 'post', 'custom_post_type') ); | |
return $query; | |
} | |
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 my_function() { | |
if ( is_category() && $query->is_main_query() ) { | |
$query->set( 'post_type', 'custom_post_type' ); | |
return $query; | |
} | |
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 my_function() { | |
if ( is_category( 'category-slug' ) && $query->is_main_query() ) { | |
$query->set( 'post_type', 'custom_post_type' ); | |
return $query; | |
} | |
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 my_function() { | |
if ( is_category() && $query->is_main_query() ) { | |
$query->set( 'orderby', 'title'); | |
$query->set( 'order', 'ASC' ); | |
return $query; | |
} |
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 | |
$args = array( | |
// arguments for your query | |
); | |
// the query | |
$query = new WP_Query( $args ); | |
// The Loop | |
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post() : | |
// contents of the Loop go here |