The MU forums have moved to WordPress.org

NextGEN and TagCloud (1 post)

  1. realsol
    Member
    Posted 15 years ago #

    I know this has been asked before so I thought I would share how I do it.

    I added a tag cloud to my side bar and added a POST called 'Custom Gallery'. Each time I add a new gallery and tag the pictures, I go to my 'Custom Gallery' post and add new tags there. Most the time the tag's are already there anyhow, but I check. This way, my Tag Cloud will pick up my new tags.

    Then for the body of the post (I am using the exec-php plug-in) I put in:

    <?php
    $clicktodisplay = "Click on a TAG in the TAG Cloud to customize your photo album.";
    if ($_REQUEST["tag"] <> "")
    {
    $tags = str_replace(' ',',',$_REQUEST["tag"]);
    $albumtag = '[albumtags='.$tags.']';
    echo $albumtag;
    //Comment out the line above and un-comment the one below if you want the gallery tag option instead.
    /* $albumtag = '[tags='.$tags.']'; */
    $content = str_replace('[nextgen-tagcloud]',$albumtag,$content);
    } else echo $clicktodisplay;?>

    Seems to work fine although NextGEN doesn't support multiple tag searches like tag1+tag2.

    I would also like to figure out how to search tags like tag1+tag2 so the return is only the pictures that include both tags. Does anyone no how to do this?

    Also, I do this within the post. I want to create a plugin to do this without php within the post. I tried:

    add_filter('the_content', 'my_nextgen_tagcloud_filter_post');

    but it seems that NextGEN has already looked for the [albumtags=tag,tag,tag] shortcode prior to me putting it their from the plugin, since it is ignored, unlike if I do it from inside the post.

    Could someone tell me how I can replace the shortcode before nextGEN shows up looking for it?

    Thanks.

About this Topic

  • Started 15 years ago by realsol