Not so common HTML transition to wordpress issue

At the end every html tag, not self self closing tags, can be used how ever you want. Want to build a website using only <span>, go for it. Going by symantic html. A <section> can contain a <header> and <footer>, symantical that is correct. You can have multiple <header> and <footer> tags, they should … Read more

Adding conditional text to a PHP Shortcode Template

The strings use in your plugin are using translatable strings ie. _e( ‘Inbox’, WPC_CLIENT_TEXT_DOMAIN ) It would probably be a better idea to use a translation plugin such as WPML or Polylang as opposed to trying to do this conditionally within the template files. However, if you prefer to do this within the template file … Read more

How to create templates for a custom module to show on the front end within my theme?

Templates in wordpress just needs to be valid PHP files. You need to place your template inside theme ( or child theme directory ). Have you placed the template in plugin directory ? if yes it won’t work. https://gist.github.com/gmazzap/1efe17a8cb573e19c086 Template file set via setTemplate must be in theme (or child theme) folder. For more details … Read more

wordpress posts template remove default template from menu

If you want to change only the text you can hook into default_page_template_title add_filter(‘default_page_template_title’, ‘bt_change_default_page_template_title’, 10, 2); function bt_change_default_page_template_title ($text, $meta) { if ($meta === ‘meta-box’) return ‘My custom template’; return $text; } Add this code into functions.php and thats it. Tested on a clean wordpress install, this will only change the text and nothing … Read more

How can I display the number of post associated to a category in Twig/Timber WordPress? [closed]

You’re assuming that get_terms() returns an object with a count property, but it doesn’t. From the docs: Return (WP_Term[]|int[]|string[]|string|WP_Error) Array of terms, a count thereof as a numeric string, or WP_Error if any of the taxonomies do not exist. See the function description for more information. Also, the way you’re calling get_terms() is deprecated. There … Read more