Support » Fixing WordPress » Creating a new is_

  • Resolved fusionxn1

    (@fusionxn1)


    I have seen plugins with custom is_ tags and I need one more for my new skin i have designed and coded.

    Its for my gallery im using the fgallery (not the flickr one the other one) and it doesn’t have one included and i need one to highlight my button when a user is browsing the gallery. The buttons are coded but awaiting this.

    If i can do it without the is_thats fine as long as i dont have to add a ?g=yes to the web address (using the php $_GET[‘g’]; tag).

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Guh?

    A little more lengthy explanation of what you’re talking about might get a useful response. 🙂

    Is the “is_*()” function you need listed here: http://codex.wordpress.org/Conditional_Tags

    Thread Starter fusionxn1

    (@fusionxn1)

    ..no

    Ok.. like is_home()

    I want to add one like is_section()

    so you goto “section” and it detects it – i can then use it to change images for just that 1 page.

    is_section() or something

    What sort of “something”. Like a category?

    Thread Starter fusionxn1

    (@fusionxn1)

    ok right i have buttons for

    home | pages | section

    when you goto section the image section changes to green to show your on there.

    Back up 3 steps and tell me, in WordPress terms, what you think a “section” is as it relates to a WordPress blog.

    I’m just not familiar with the term. Is “Section” a WP Page? A Category?

    Thread Starter fusionxn1

    (@fusionxn1)

    Ok lets do detail.

    I have a blog, it has the Homepage known as Home, A page known as PAGE1 and a Plugin known as Section.

    I have images in green at the top as navigation one for each Home, PAGE1 and Section. I want to make a custom is_ tag or php script so that when a visitor goes to Section the image for Section changes from green to blue to show thats where they are.

    Okay? 🙂

    My skin is complete to see what I mean have a look:

    http://www.fusionxn1.com/blog/

    when you goto gallery the image does change so i need to create one for that!

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Ah. I assume you’re talking about the gallery link on the extreme right then? The other two appear to be normal pages.

    It’s a bit hard to say exactly how you’d write code to detect when they’re looking at the gallery without knowing how you’re intercepting requests that are causing the gallery page to display. What plugin is it, exactly? How does it work? What is it doing?

    Details are critical.

    Thread Starter fusionxn1

    (@fusionxn1)

    first post i said:

    Its for my gallery im using the fgallery (not the flickr one the other one) and it doesn’t have one included and i need one to highlight my button when a user is browsing the gallery. The buttons are coded but awaiting this.

    Thread Starter fusionxn1

    (@fusionxn1)

    Ok i did it.

    In my header i put the following:

    <?php

    if (defined(‘isgallery’)) {

    $iamgallery = yes;

    } else {

    $iamgallery = no;

    }

    ?>

    and on my nav image i put:

    class=”<?php if ($iamgallery == yes) { ?>current_gallery_item<?php } else

    {?>last_menu<?php } ?>

    so it shows the correct image (active) if $iamgallery == yes if not show it as inactive.

    Last i placed:

    <?php define(“isgallery”, true); ?>

    in the head of the plugin! Give it a shot @

    http://www.fusionxn1.com 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Creating a new is_’ is closed to new replies.