ThemeShaper Forums » Thematic

[closed]

Highlight Posts Page Menu Option

(7 posts)
  • Started 4 years ago by thomasjamesthomas
  • Latest reply from thomasjamesthomas
  • This topic is not resolved
  1. Flashblog here : http://www.thumbleaf.com

    When you land on the blog you get to the posts page (ActionScript) and I would like that page to automatically highlight the menu ActionScript option.

    Similar to if you click on ActionScript in menu and (also) get to the posts page: You can see that then it is highlighted.

    What php is required for this? I am aware that of course you could set a static page to your front page and then the menu will highlight that static front page when you get to the site.

    But I don't want that; I want my posts page as front page and I would like to have it highlighted from start when you first get to page so that it is clear that that is the page you are viewing. Observe, please visit site to see what I mean as the highlighting is already working, just not for when u first get to site...

    Thanks

    Thomas

    Posted 4 years ago #
  2. Hi Thomas,

    remove the page 'ActionScript' and add the following code to your child theme's functions.php:

    function childtheme_menu_args($args) {
        $args = array(
            'show_home' => 'ActionScript',
            'sort_column' => 'menu_order',
            'menu_class' => 'menu',
            'echo' => true
        );
        return $args;
    }
    add_filter('wp_page_menu_args','childtheme_menu_args');

    Chris

    Posted 4 years ago #
  3. Great !

    Thanks for your help there Chris ^^

    Thomas

    Posted 4 years ago #
  4. Hum,

    well it did insert ActionScript in menu but I cant get it to highlight as if it was the preselected option see : http://www.thumbleaf.com

    I tried changing 'menu_class' => 'menu', to 'current_page_item' to indicate that i want ActionScript highlighted similarly to if you would go to one of the other pages but didnt work.

    Hum, Any ideas of how to also highlight ActionScript ? The CSS for menu from CLASSIC.css :

    .menu {
    padding:7px 0 8px 0;
    overflow:hidden; /* clears the inner float */
    }
    .menu ul,
    .menu ul {
    margin:0;
    list-style:none;
    clear:both;
    }
    .menu ul ul {
    display:none;
    }
    .menu li {
    display:inline;
    }
    .menu a {
    display:block;
    float:left;
    margin:0 10px 0 0;
    padding:1px 6px;
    background:#cccccc;
    color:#000000;
    border-top:1px solid #cccccc;
    text-decoration:none;
    }
    .menu a:hover {
    background:#cccccc;
    color:#000000;
    border-color:#3B86C7;
    }
    .menu .current_page_item a {
    background:#5C9BD1;
    color:#fff;
    border-color:#3B86C7;
    }
    .menu a:focus {
    background:#4887BD;
    color:#fff;
    border-color:#2772B3;
    }

    Thanks,

    Thomas

    Posted 4 years ago #
  5. thomasjamesthomas-

    Strange... using Chris's code I cannot recreate your problem. Looking at the source of your page:
    <ul class="sf-menu"><li ><a href="http://www.thumbleaf.com/journal">ActionScript</a>
    It looks as if something is stripping out the .current-page-item from your blog page <li > Why the space after the li ?

    Post any parts of your functions.php that you have used to change thematic_access or filter wp_page_menu_args

    -Gene

    Posted 4 years ago #
  6. Hum

    The only thing I done is add Chris function...Can this be related to that I have no longer a page named ActionScript; just inserting it in the menu?

    Well If I cant crack it tomorrow I will have to wait a week as Im off for holiday no worries ,

    Thomas

    Posted 4 years ago #
  7. www.thumbleaf.com

    it now works \o/ yayayaya yahoo!

    My fault sry, I forgot to change the page option in Reading settings. It was still on my old setting but altered it to front page equals blog posts...Now works.

    !

    Thomas

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.