Conditional custom menu?

I do not believe a plugin would be needed for this. You could add a class to the menu item (enable the class field under Screen Options when you are editing the menu item). Also be sure that you have the body_class() function applied to your body tag. Then you can do: .your-menu-item-class { display: … Read more

Can you echo PHP code from a variable?

Since actual output seems to be done via echoing global variable nothing prevents you to change that variable to something else (between the points where theme creates and echoes it). Like a result of advertisement manager function call. However I think it would make more sense to stick with one of two functionalities rather than … Read more

How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?

You can use the following filter: add_filter(‘wp_list_pages’, ‘foo_bar’); function foo_bar($html){ //Create a regex pattern to identify the LI element with preg_match //Create another pattern to identify the class attr and alter it with preg_replace return $html; } As I’m not familiar with the exact elements you are working with, I can’t write up a regex … Read more

How can I remove page titles without removing the link in the navigation bar in twentyeleven?

You’ll need to remove the_title(); section from the following templates: content-aside.php content-featured.php content-gallery.php content-image.php content-intro.php content-link.php content-page.php content-quote.php content-single.php content-status.php content.php Open the files and look for this: <h2 class=”entry-title”> <a href=”https://wordpress.stackexchange.com/questions/33038/<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyeleven’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”> <?php the_title(); ?></a> </h2> The content will … Read more