Custom post type is using the index.php template

public is false by default, your post type will not be visible on the front end without explicitly setting it to true. $post_args = array( ‘public’ => true, ‘label’ => _(‘Blog Post’), ‘description’ => _(‘Site\’s blog posts’), ‘show_ui’ => true, ‘show_in_nav_menus’ => true, ‘taxonomies’ => array(‘blog_posts’), ‘supports’ => array(‘title’, ‘editor’, ‘comments’, ‘trackbacks’, ‘thumbnail’), ‘capability_type’ => … Read more

How to hide the menu item created by the theme in WordPress admin panel?

As a temporary solution, add below script to the function.php file wp_enqueue_style( ‘flatsome-hide’, get_stylesheet_directory_uri() . ‘/css/flatsome.css’, array(‘flatsome’), ‘1.0’ ); Crete a CSS file called “flatsome” inside your CSS directory, or whatever you prefer, make sure you update the name and the path on function.php. Then inspect the menu class and hide it using display: none … Read more

How to remove products-links after the product title using remove_action

First, you’re correct that removing the action calling the products_links method would work, and that this is specifically MrBara_WooCommerce->products_links(). In your functions.php, you can just use remove_action without wrapping it in a function used as a callback for another add_action, btw. so: remove_action(‘products_links, array(‘MrBara_WooCommerce’, ‘woocommerce_single_product_summary, 0) 10 is default priority, and while we may assume … Read more

Default Nav Highlight

Assuming you are loading a single piece of content like one Post (unlike the homepage where you’re combining multiple Pages with JS), something like this should do it: <script type=”text/javascript”> $(document).ready(function(){ // get each menu item var hasHighlight = 0; // loop through to see if any have “current_page_item” class $(“#nav ul li”).each(function(obj) { if($(this).hasClass(“current_page_item”)) … Read more

Is it possible to open a page with a different theme?

Every solution to changing a theme on every click of Home button will result in many activation and deactivation requests. Some settings might get messed up for example widgets in the sidebars and menus etc on different theme activation. Also, it will require a proper setup in coding making current pages conditions in both themes. … Read more

Removing the references to the wp-content folder

It is definitely bad practice to try to move themes (or uploads or plugins) outside of the wp-content folder. WP’s structure ensures that WP can find all the necessary resources. Anytime you move things outside of its structure, odd quirks and broken bits tend to appear. So, stick with /wp-content/themes/your-theme-slug/ and make things more dynamic. … Read more

get_comments_number() returns 0

From quick look at the source there seems to be three possibilities: get_post() returned falsy value, so current post context is invalid in some way. $post->comment_count is 0. get_comments_number filter is being used to adjust the output. Most commonly it would be case 1/2 with something interfering with global post context, dump get_post() at the … Read more

Why does wordpress add Theme not list a specific theme anymore?

Official repositories will omit themes and plugins that hadn’t been updated in two years from search and APIs. If you can find theme on repository site this is shown by following warning: This theme hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when … Read more