ThemeShaper Forums » Thematic

conditional tags for lava lamp

(6 posts)
  • Started 6 years ago by alst
  • Latest reply from alst
  • This topic is resolved
  1. alst
    Member

    Hi, have managed to integrate the lava lamp jquery function into thematic to make a nice dynamic touch to the top menu. See http://www.gmarwaha.com/blog/?p=7.

    Apparently to make the dynamic bar/background start on the right page you have to add a class="current" to the li of the menu page. I have got lava lamp working with the sandbox_global nav function in the hooks and filters file, but don't for the life of me know how to add the class for each dynamically generated li.

    On the page above, people have mentioned the use of conditional tags for wordpress users to get this to work.

    Would love some starting help if any one has an idea.

    Cheers,

    Alistair

    Posted 6 years ago #
  2. If you have to make a custom menu, this'll work

    <li class="<?php if ( is_page('about') ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_option('home') ?>/about/" title="About This Blog">About</a></li>

    But wp_list_pages currently spits out <li class="current_page_item"> and <li class="page_item">.

    Posted 6 years ago #
  3. alst
    Member

    Thanks for the really quick reply Ian.

    So basically, from what I see here, I could make a ul with the listed pages below using the code above then write some "if" statements to apply the class="current" depending on the page I am on.

    But this will mean I lose the dynamically created menu by sandbox_globalnav.

    Is this correct?

    Posted 6 years ago #
  4. Sorry, I just looked at the code on the example page: you don't need to edit anything. All the markup you need is provided by sandbox_globalnav.

    Posted 6 years ago #
  5. alst
    Member

    Hi Ian, have just been pouring through all sorts of stuff re wp_list_pages, sandbox and conditional statements.

    I am smarter for it, but no further ahead.

    To get the lava effect to "stick" on the actual current page i need to get the sandbox_nav function to either add the class "current" to the li which has the class "current_page_item" or replace it.

    Don't quite have the grasp of php yet to do this,

    or am i being exceptionally stupid?

    Posted 6 years ago #
  6. alst
    Member

    i am embarrassed.....

    it only just occured to me to look at the js files themselves.

    all sorted.

    (for those that may be watching or care, change the following in the jquery.lavalamp file,

    ......appendTo(b),$li=$("li",this),curr=$("li.current",this)......

    to

    ......appendTo(b),$li=$("li",this),curr=$("li.current_page_item",this).....

    Posted 6 years ago #

RSS feed for this topic

Reply

You must log in to post.