How to specify which Gutenberg blocks are available in the editor for a page template

Using an example given here: enter link description here I’ve successfully been able to restrict the block types available globally or by post type (eg: page). But what I really would like to do is restrict the the block types by page template. I have tried using if ( is_page_template(‘page-home.php’) ) {…} but with no … Read more

Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template

I have the following function set up in my functions.php file to allow my custom post type “Slideshow” to work. add_action( ‘the_post’, ‘paginate_slide’ ); function paginate_slide( $post ) { global $pages, $multipage, $numpages; if( is_single() && get_post_type() == ‘lom_slideshow’ ) { $prefix = “slide{$i}”; $multipage = 1; $id = get_the_ID(); $custom = array(); $pages = … Read more

Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !

What I want to do is a loop like this is something like this I’m really sorry but its hard to format here! I going to put this short url http://pastebin.com/dEdKzgJz so you can see it better… Can anyone help me with this? Any advice! Category 1 ……..Child Category 1.1 ………..Sub-Child Category 1.1.1 ……………..Post Title … Read more

Subpage template

I’ve had a look around already but couldn’t find an answer to this. Is there a way to create a template that applies to all pages that have a parent? something like sub-page.php without having to manually select it from the page attributes? 1 Answer 1 Just build it directly into your page.php template. e.g.: … Read more

Customize edit.php Pages listing in dashboard to show only pages with a particular template applied?

The question says it all, I think. I’d like to create a new submenu page using edit.php which will only display pages which use a certain template file (or files). Possible? 2 Answers 2 Try this: <?php // add submenu page add_action(‘admin_menu’, ‘add_template_submenu’); function add_template_submenu() { add_pages_page( ‘My Template’, ‘My Template’, ‘edit_pages’, ‘edit.php?post_type=page&template=your-template-file.php’); } // … Read more