doubled content

The loop in your code: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> is saying “if I have posts, display them all – by the declared # per page” So you need to modify the loop to only display the content you need. Can you provide some information on where … Read more

What is the scope and persistence of add_filter() and remove_filter()?

It is always global. add_filter() and add_action() are just wrapper for the global variable $wp_filter. So it doesn’t matter where the function is called. The same is true for apply_filters(), apply_filters_ref_array(), do_action_ref_array() and do_action(): they work in the global namespace, that’s the reason why the callback handlers (functions or methods) have to be public. A … Read more

Submenu opened problem

Within a WordPress framework, you can do this with a combination of body_class and CSS. body_class will echo classes into the <body> tag, including a page-parent class, which you can then use to control your elements. Without seeing your actual WordPress page, I can’t give you the necessary CSS.

Exclude Specific Categories?

You could do it like this: <?php $exclude = array( ‘home-featured’ ); foreach( get_the_category() as $category ) { if ( ! in_array( $category->cat_name, $exclude ) echo $category->cat_name . ‘ ‘; } ?>