WordPress.org

Ready to get started?Download WordPress

Forums

Simple Fields
Display Gallery in Simple Fields (6 posts)

  1. Filespit
    Member
    Posted 1 year ago #

    Hello,

    I am using Simple Fields on my website as an extra source of content. In my Simple Field I want to display a Gallery. I click "add media", select my images and click "insert gallery". However, when I update my page and view it, it only displays the shortcode instead of displaying the actual gallery. When I view my Simple Field in standard view I can clearly see the gallery, and when I click html view I see the following.

    [gallery columns="5" rel="lightbox" ids="25"]

    As said, this is what is displayed instead of the gallery. Have I missed something here, or is it not possible to have galleries in a Simple Field?

    http://wordpress.org/extend/plugins/simple-fields/

  2. Pär Thernström
    Member
    Plugin Author

    Posted 1 year ago #

    I haven't tried the gallery function, but perhaps the filter for the gallery function is not fired from simple fields. Try and see if this helps:

    $content_from_simple_fields = <your code that fetches info from simple fields>;
    $content_from_simple_fields = apply_filters( 'the_content', $content_from_simple_fields );
    echo $content_from_simple_fields;
  3. Filespit
    Member
    Posted 1 year ago #

    Hi Pär,

    I tried this, but it only returns Array

    <?php $content_from_simple_fields = simple_fields_get_post_group_values($post->ID, "galleri-grupp", true, 2); 
    
    $content_from_simple_fields = apply_filters( 'Galleri', $content_from_simple_fields );
    
    echo $content_from_simple_fields;
    ?>

    Perhaps I wrote it all wrong?

  4. hakerdesign
    Member
    Posted 1 year ago #

    hi
    i have the same probelm

    did you solved the issue

    i really would like to present next gen shortcode

    any clues

    thanks

  5. hakerdesign
    Member
    Posted 1 year ago #

    hi just wanted to let everyoneknow
    that the above solution works!

  6. scharc
    Member
    Posted 1 year ago #

    Hey Guys,

    I was on the same quest to figure out, why my jq lightbo auto plugin didnt work on simple fields wysiwyg fields and the tip to add the appley_filters() hook was awesome ...

    maybe that should go into the faqs because its a pain when shortcodes and a lot of plugins wont work on simple fields

    here is my solution for lightbox support:

    $field_group_values = simple_fields_fieldgroup("content_widgets");
    foreach($field_group_values as $widget){
    $widget['content_widget_content'] = apply_filters( 'the_content', $widget['content_widget_content']);
    echo $widget['content_widget_content'];
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic