About this topic

  • Posted by zumajoe 1 year ago. There are 3 posts. The latest reply is from byron.
  • This topic is not resolved

No tags yet.

  1. Is there a place I can modify the PhotoSmash plugin so that it will only Auto-add galleries to certain categories of posts?

    Is there any way to make it so only a certain post category will add a gallery? (Ex: only add gallery to "Events" category, but "News" posts will not?)


  2. Hi Zuma,

    I'd recommend using apply_filters in the autoAddGallery function...do it after:

    if($psoptions['auto_add']){
    
    //add this
    $display_gallery = apply_filters( 'bwbps_gallery_exit', true );
    
    if( !$display_gallery ){ return $content; }

    If you use the code above, I'll see if it works and put that apply_filters into the core so you don't lose your fix on the next upgrade. I haven't tested, so don't know if that works or not.

    Next, you'll need a filter function (which you can set up in your own plugin or in your theme's function.php file, you can use the is_category conditional: http://codex.wordpress.org/Function_Reference/is_category

    Your filter function would need to determine whether it's the right category or not...then return true or false.

    Hope that helps,
    Byron

RSS feed for this topic