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

posts page – different lengths of excerpt

First, you need to filter excerpt_length. Assuming you want your default excerpt length to be 50 words: <?php function wpse53485_filter_excerpt_length( $length ) { return 50; } add_filter( ‘excerpt_length’, ‘wpse53485_filter_excerpt_length’ ); ?> That will make all excerpts 50 words. Make sure that works first. Then, add in an appropriate conditional, to use a different excerpt length … Read more

How to have a custom display for both woocommerce archive and product-category pages? [closed]

Generally, you can tell WordPress to load a different template. The mostly seen approaches make either use of the template_redirect or the template_include hook. It is preferable to use template_include as described in this article. Following an example on how to approach this: Code: // load the woocommerce category archive template add_filter( ‘template_include’, ‘wpse138858_woocommerce_category_archive_template’ ); … Read more

How to customize search result page title?

Within the wp_get_document_title() function we have: // If it’s a search, use a dynamic search results title. } elseif ( is_search() ) { /* translators: %s: search phrase */ $title[‘title’] = sprintf( __( ‘Search Results for &#8220;%s&#8221;’ ), get_search_query() ); so you could hook into the document_title_parts filter to adjust it to your neds. Example: … 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.