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

Get template part vs locate template function

First of all note that get_template_part internally uses locate_template, so your feeling that the latter is slower is wrong. If you look at the code, get_template_part is little more than a wrapper for locate_template, so if one work and the other not, there are 2 possibilities: you are using get_template_part wrong there’s some hook on … Read more

Template files missing after moving site

Sounds like it could be an issue with the database and serialization of the plugin options. I’ve had problems before with plugin settings etc when moving a site using the xml export. The category templates plugin writes a lot of options to the db and they could be corrupted. As a test try creating a … Read more

How to create tag.php

Unfortunately all of your code is wrong. What you are doing is the same as query_posts, which should never be used. Also, never swap the main query on any type of archive page or on the home page for a custom query To create a tag page, just simply make a copy of your index.php, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)