WordPress.org

Ready to get started?Download WordPress

Forums

Integrating lazy gallery link into dynamic highlighting menu problem (8 posts)

  1. tWS
    Member
    Posted 9 years ago #

    I have installed Lazy Gallery and it is working fine, however I want to place a link to the gallery in my dynamic menu at the top and have it dynamically highlighted when I select it. Currently, my other pages (which are WP pages) are dynamically highlighted using the 'is_page' function. How do I dynamically highlight the lazy gallery page? I've been trying to use 'isset' but being a PHP novice I can't get it to work.

    My dynamic menu part of header.php currently looks like this -


    <?php

    if ( is_page('Biographies') ) { $current = 'biographies'; }
    elseif ( is_page('Link List') ) { $current = 'linklist'; }
    else { $current = 'weblog'; }
    ?>

    ...

    <div id="navlist">

  2. Weblog
  3. Biographies
  4. Link List
  5. </div>

    the Whole Shhbang can be found at http://c0axial.co.uk/shhbang/shhbang-cms

    Some help much appreciated.

  • Lorelle
    Member
    Posted 9 years ago #

  • tWS
    Member
    Posted 8 years ago #

    Thanks Lorelle but unfortunately that info doesn't solve my problem. I've just looked at your site and you use a gallery similar to what I want but with WP pages. How did you do this? Are you using a plugin similar to lazy gallery?

    The issue is more of a PHP one I guess, but in relation to dynamically highlighting both WP pages and static pages in a horizontal menu. Any ideas?

  • jwurster
    Member
    Posted 8 years ago #

    You might have to build the link yourself. Have you tried "...yourdomain/lazy-index.php"?

  • tWS
    Member
    Posted 8 years ago #

    My problem is related to getting the lazy-index.php into my dynamic menu and more importantly getting it to highlight correctly using some sort of 'isset' or similar function together with the 'is_page' WP function ??

  • jwurster
    Member
    Posted 8 years ago #

    How about doing an "if function('showGallery')".

  • tWS
    Member
    Posted 8 years ago #

    Would I need to use an 'include' or 'require' pointing to the lazy-gallery.php to use that function in my header.php? Not entirely sure.

  • jwurster
    Member
    Posted 8 years ago #

    Now that I see what is meant by dynamic, you would make a page for your gallery. Then you would use the same logic above. However, I haven't gotten that to work completely yet. The page works fine, but when I click on a gallery, I am not sent to the gallery but to the first page in my blog. Haven't figured that out yet. Maybe you will have better luck.

    I have had success creating a link directly to lazy-index. See http://www.jwurster.us/wordpress/lazy-index.php. I have it modified to use some of my sidebar stuff.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags