Forum Replies Created

Viewing 4 replies - 16 through 19 (of 19 total)
  • Is your code executing inside The Loop? If not, I think I know why it didn’t work.

    ‘the_ID()’ function only works if you are inside The Loop. If you are outside The Loop, you’ll have to get the post ID another way.

    Try this:

    <?php
    // get the current page ID
    $the_page_id = $post->ID;

    // create array of page ID’s we want to check for
    $page_ids = array(6,12,13,14);

    // see if the current page ID is in the array
    if(in_array($the_page_id,$page_ids)){
    echo ‘hooray! this is a special id!’;
    }
    ?>

    I tested this code on my site and it works.

    PHP’s in_array() function might be what you are looking for. You could use something like this:

    <?php
    // create array of page ID’s we want to check for
    $page_ids = array(6,12,13,14);

    // see if the current page ID is in the array
    if(in_array(the_ID(),$page_ids)){
    // the_ID() was in the array!
    // your code here
    }
    ?>

    Also, as at least one of you mentioned, if the $page_ids array is going to contain the children of a specific page ID, you may want to read about WordPress’ get_children() function. I haven’t used that function, and there isn’t much documentation on it, but it may enable you to automatically populate the $page_ids array from the WordPress database.

    Thread Starter justinbarkhuff

    (@justinbarkhuff)

    The photo gallery interface is driven by a customized version of lightbox2.

    In my customized version, I:

    • added the slide show functionality
    • moved all visual specifications to the css file
    • rewrote lots of the code to better utilize the prototype.js library
    • customized the images

    Here are the links to my customized lightbox.js and lightbox.css (lightbox.css has image dependencies that you will find in the css code):

    Thread Starter justinbarkhuff

    (@justinbarkhuff)

    The huge space at the bottom is a result of the location map being ‘hidden’ by default (look for the location map at the top right corner of the site).

    The location map has a default top coordinate of ‘-250px’, but for some reason, FF still renders the 250px of space. When you click “see map”, the location map animates down, and the space at the bottom disappears.

    I tried a few things to get rid of the space when the location map is ‘hidden’, but nothing I tried seemed to work.

Viewing 4 replies - 16 through 19 (of 19 total)