How to detect /category and /tag base pages?

There is no good way to do this, but it can be done in a way. When you visit /category/ it serves it as though you are visiting a page called category. You can look for this like: global $wp_query; if ($wp_query->query_vars[‘pagename’] == “category”) { // This is base category } else if ($wp_query->query_vars[‘pagename’] == … Read more

Custom nav menu not showing

Maybe you are doing it wrong? Here’s a pointer… In functions.php // This theme uses wp_nav_menu() in one location. register_nav_menus( array( ‘primary’ => ‘Primary Menu’, ) ); In header.php (or elsewhere) <?php wp_nav_menu( array( ‘theme_location’ => ‘primary’ ) ); ?>

How to format the first line of a post differently?

Here is the idea add_filter(‘the_content’, ‘testfunc’); function custom_formatter($matches){ return “<strong>{$matches[0]}</strong>”; } function testfunc($content) { $pattern = “$\<p.*\>(.*)\<\/p\>$”; $content = preg_replace_callback($pattern, ‘custom_formatter’, $content); return $content; } However, you will need a better regular expression in $pattern variable as this regex may be very poor. in the custom_formatter function you can do the formattings you want.