• Resolved ragnylromero28

    (@ragnylromero28)


    Good day!

    Is it possible to change the usage of each gallery when use in custom post type? Right now all galleries usage value is “not used” since I only use it on custom post type. But when I tried to use it on post type the value changes to post’s name. How can I make the plugin detect when use in custom post type? Or is it possible or not?

    Thanks,
    Ragnyl

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author bradvin

    (@bradvin)

    hi Ragnyl,

    FooGallery only supports posts and pages, but there is a filter so that it will work with other post types.

    You can add this snippet to your functions.php which will get it working:

    
    function ragnyl_foogallery_allowed_post_types_for_attachment( $post_types ) {
      $post_types[] = 'your_custom_post_type';
      return $post_types;
    }
    add_filter( 'foogallery_allowed_post_types_for_attachment', 'ragnyl_foogallery_allowed_post_types_for_attachment' );
    

    You will need to edit the above and change ‘your_custom_post_type’ with the actual post type in your scenario.

    Thread Starter ragnylromero28

    (@ragnylromero28)

    Hello bradvin,

    Thank you for your reply. I tried to add the code snippet you provided to my current theme’s function.php but it’s not working. I already changed the ‘your_custom_post_type’ to ‘growing’ as my custom post type but still not working. Is there any way to do it?

    Thanks,
    Ragnyl

    Plugin Author bradvin

    (@bradvin)

    hi @ragnylromero28

    I tested this locally and found the problem. Even though the code snippet now links the galleries to your custom post type, there is code missing to pull the new post type when displaying the gallery listing.

    So it is doing the linking in the database, but its not displaying. I have added the code to pull usages from the same list of custom post type, and this will be released in the next version

    Thread Starter ragnylromero28

    (@ragnylromero28)

    Hello bradvin,

    Ok I’ll just wait for the release of the next version. Thank you so much!

    Sincerely,
    Ragnyl

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Usage = not used in custom post type’ is closed to new replies.