Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Plugins
    In reply to: Custom Post Type Parent

    I used a simple jquery script to handle my problem.

    $(function() {
    
    	if ($("body").hasClass("single-products")) {   // single-products is the name of my template page for the custom post type
    
    		$("li.page-item-19").removeClass("current_page_parent");   // Removes the class current_page_parent from the <li> with the page-id of the Blog (News)
    
    		$("li.page-item-11").addClass("current_page_parent");   // Adds the class current_page_parent to the <li> with the page-id of the Products page
    	}
    
    });

    Note: the body tag needs to have <?php body_class(); ?> for it to spit out the class for your custom post type page on the body tag.

Viewing 1 replies (of 1 total)