exclude one child by id from $post->post_parent

Maybe it’s just a matter of parentheses. if ( ( $post->post_parent == ‘4426’ || in_array( ‘4426’, $post->ancestors) ) && !is_page(4430) ) { // Who We Are //do something } I’m assuming is_page accepts an Integer being the page ID and 4430 is not the slug or page title.

Custom permalink based on custom post type fields

Look at the filter for rewrite_rules_array and add a re-write rule to re-write /products/category-name/sub-category-name/product-name to index.php?pagename=product-name. You might need to grab the category-name and sub-category-name too if your product-names are not unique. Then add a query var for product-name using the query_vars filter. Once you’ve done that in your new post type template you can … Read more

Hiding menu on mobile only when viewing posts?

Assuming you are editing a child theme (or somehow protecting your changes from future update/over-writing) a very simple way to accomplish this is with a CSS rule that targets your mobile menu, then applies display: none to it. Using a combination of media queries and carefully written CSS selectors, you can target exactly the HTML … Read more