How to translate WP Blog (search, category etc.)?

If you have bought a theme you should have support for other languages. See the chapter Internationalization in the theme developer handbook for more information, or e.g. more specific on translation functions like __() the Code Reference. If you independently developed a theme, you probably forgot about this element. If not, check if your theme … Read more

get_the_post_thumbnail() produces different HTML on same arguments

So I found the issue. The twentyseventeen theme has a built-in function in functions.php that does this: Add custom image sizes attribute to enhance responsive image functionality for post thumbnails function twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) it has an if (is_archive()) condition in there. I had to override the function with my own custom function … Read more

wp_enqueue_style $dep argument does nothing?

The 3rd argument of wp_enqueue_style means when enqueuing this stylesheet make sure it is after the list of dependencies. In your case, prior to enqueueing the child-style WordPress make sure that parent-style is enqueued first. Even though the enqueued statements are in the correct order: wp_enqueue_style(‘parent-style’, get_template_directory_uri() . ‘/style.css’); wp_enqueue_style(‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’); There will … Read more

Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?

You will be rejected from the WordPress.org theme direcotry if you include these post types in the theme. The guidelines, which are available here, state: Non-design related functionality is not allowed. (See: Plugin territory examples) And one of the examples is: Custom Post Types and Shortcodes Regarding TGM, the guidelines have this to say: Themes … Read more

Can’t switch to a child theme using filters template, option_template and option_stylesheet

For a parent theme, template and stylesheet should be the same, which is the name of the parent theme directory. But for a child theme, template should be the parent theme’s directory name, whereas stylesheet is the child theme’s directory name. So if you’ve got the following: Parent theme: Twenty Nineteen (directory name: twentynineteen) Child … Read more