Gutenberg Editor – Template Doesn’t Match Error

This is a known issue. A hack would be to disable to the validation completely for the block. Chris Van Patten provided the following code example: /** * WordPress dependencies */ import { compose } from ‘@wordpress/compose’; import { withDispatch } from ‘@wordpress/data’; import { InnerBlocks } from ‘@wordpress/editor’; /** * Container block * * … Read more

Restrict a search to a custom post type

You can restrict a search to a custom post type by modifying a basic WP search form like this: <form id=”cptsearch” action=”<?php echo home_url(); ?>” method=”get”> <input type=”text” name=”s” /> <input type=”hidden” name=”post_type” value=”POSTTYPENAME” /> <input id=”searchsubmit” type=”submit” alt=”Search” value=”Search” /> </form> To select a specialized template for the custom post type search, add this … Read more

Gutenberg & Pre-formatted Templates: Core Block Attributes

To partly answer my own question: As mentioned in this git issue you can use console.log(wp.blocks.getBlockTypes()); in the browser console after all the Gutenberg magic loaded (e.g. in the editor window of a post) to show all currently registered blocks, inluding their attributes. Another Info-Source: The Git-Project of Gutenberg holds all core blocks and their … Read more

Tools for Converting an Existing Website Design to a WordPress Template?

Here is a free and good step by step tutorial with video. How To Convert an XHTML Website Template into a WordPress Theme http://www.jonbishop.com/2010/03/convert-html-wordpress/ There are many tools on market which claims to PSD/Xhtml 2 WordPress http://www.divine-project.com/ http://www.artisteer.com/ http://www.artisteer.com/ but coding manually is the best way. No quick way to get custom and great themes.

How to hide/redirect the author page

You can do this at an earlier moment by hooking into the right action, like template_redirect, which fires right before the template will be displayed. add_action( ‘template_redirect’, ‘wpse14047_template_redirect’ ); function wpse14047_template_redirect() { if ( is_author() ) { $id = get_query_var( ‘author’ ); // get_usernumposts() is deprecated since 3.0 $post_count = count_user_posts( $id ); if ( … Read more

Programmatically change post templates?

I take it that you mean saving the pages with a new post-template to the DB? see if there’s anything in the post object that refers to the page-template, if so craft a query that updates that. Update: Taken from the wp_insert_post documentation NOTE: The page_template key was removed from the $post table and is … Read more