Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1225

    I currently have 4 portfolios, 2 of which are based on art/images and the other 2 are based on writing/editing.

    Is it possible to change the code so that the images in the writing/editing portfolio will link to their respective posts and for the fun stuff-nyc/artwork to still use lightbox?

    Thanks in advance!

    toomanycommas.com/test

    #34471

    This should be possible – open template_portfolio.php and replace following code

    <?php
    echo '<a href="'.$portfolio_image.'" rel="lightbox[portfolio]"><img class="aligncenter" src="'.$portfolio_image_small.'" alt="" /></a>';

    ?>

    with:

    <?php
    if (is_category(array(9,18,7)))
    { echo '<a href="'.$portfolio_image.'" rel="lightbox[portfolio]"><img class="aligncenter" src="'.$portfolio_image_small.'" alt="" /></a>'; }

    else

    {
    echo '<a href="'.get_permalink().'"><img class="aligncenter" src="'.$portfolio_image_small.'" alt="" /></a>';
    }

    ?>

    Replace 9,18 and 7 with the category ids of your fun stuff categories.

    The Dude

    #34472

    Once again, worked like a charm, thank you so much Dude.

    #34473

    Glad that I could help you.

    #34474

    So back on this same topic, i switched the permalinks to no longer be default (eg /blog, /portfolio)

    When i did this the portfolio pages started linking to the blog rather than their respected pages. All the portfolio entries did the same thing.

    Is that because the portfolio pages are basically considered blog posts? Is there a workaround for this?

    I switched it back to the default permalinks so it works again but the url is toomanycommas.com

    any guidance would be greatly appreciated, thanks!

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Linking portfolio images to pages rather than Lightbox’ is closed to new replies.