Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Last active August 29, 2015 14:16
Show Gist options
  • Save eri-trabiccolo/14ade3c986e9f3086843 to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/14ade3c986e9f3086843 to your computer and use it in GitHub Desktop.
Customizr > 3.3.11 <? custom post lists
<?php /*Add the following code at the very beginning of your template file, just after the Template declarative block */ ?>
<?php
// strangely you have to set this to false, typo in the core code.
// useful just when you display the page which uses this template in home as static page
// consider that the navigation will not work properly (and not because of customizr :P)
add_filter('tc_display_customizr_headings', '__return_false');
add_filter('tc_post_list_controller', '__return_true');
// use this to display the page title
add_action('__before_loop', 'print_page_title', 0);
function print_page_title(){
?>
<header class="entry-header">
<h1 class="entry-title "><?php echo get_the_title(); ?></h1>
<hr class="featurette-divider __before_content">
</header>
<?php
}
?>
<?php /*Append the following code to your child-theme functions.php just if you want to display the page using the template as static page in home */
/* as you can see here I've not used the php starting and closing tags since
your functions.php already starts with the first and doesn't have to be closed with the second!*/ ?>
// move list headings action
add_action('after_setup_theme', 'move_list_headings_action');
function move_list_headings_action(){
if ( class_exists('TC_headings') && method_exists('TC_headings', 'tc_set_post_page_heading_hooks') ){
remove_action( 'wp' , array( TC_headings::$instance , 'tc_set_post_page_heading_hooks') );
add_action( 'wp_head' , array( TC_headings::$instance , 'tc_set_post_page_heading_hooks') );
}
}
@eri-trabiccolo
Copy link
Author

Hello Giorgio,
sorry for haven't replied, I don't get notified about new comments on gists.. do you know I could I? :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment