ThemeShaper Forums » Thematic

How to set "current_page_item" for home link

(2 posts)
  • Started 10 years ago by JasonCho
  • Latest reply from Chris
  • This topic is not resolved

Tags:

  1. JasonCho
    Member

    Hello,

    I used this code

    <li class="<?php if ( is_page('about') ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">/about/" title="">About

    and have styled current_page_item.

    I want to use this code and make a 'home' link.

    <li class="<?php if ( is_page('home') ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>">" title="">Home

    However, the current_page_item style is not applied.

    Any solutions? Thank You.

    Posted 10 years ago #
  2. Hi,

    just integrate the following code to your child theme's functions.php:

    // Adds a home link to your menu
    // http://codex.wordpress.org/Template_Tags/wp_page_menu
    function childtheme_menu_args($args) {
        $args = array(
            'show_home' => 'Home',
            'sort_column' => 'menu_order',
            'menu_class' => 'menu',
            'echo' => true
        );
    	return $args;
    }
    //add_filter('wp_page_menu_args','childtheme_menu_args');

    Chris

    Posted 10 years ago #

RSS feed for this topic

Reply

You must log in to post.