Support » Plugin: Simple Masonry Layout » Doesn’t work with Advanced custom fields

  • Resolved daknightteam


    First of all, nice job, like the simplicity.

    I was running into problems while using the shortcode in Advanced custom fields. I found that in simple-masonry-layout.php on line 38 there is a check for if the shortcode is being used in the post content. Well, mine is not because it is included in a advanced custom field. So i removed this:

    && has_shortcode( $post->post_content, ‘simple_masonry’)

    and it works perfect.

    I get that you don’t want to load all dependencies on all pages, but maybe there is another way to solving this? As it is now it completely removes any use cases outside of the post_content.

    Please consider this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • On a completely different note, I added:

    if(strpos($sm_post_type, ‘|’) !== false){
    $sm_post_type = explode(‘|’, $sm_post_type);

    in front.php on line 102. This will make to that you can use more than one custom post type in each shortcode, by putting a pipe between the names. Feel free to use it if you like the idea.

    • This reply was modified 1 year, 10 months ago by daknightteam.
    Plugin Author Tako


    Great Idea. Thank you so much for a suggestion. Will be considering on future updates.

    Cheers 🙂 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Doesn’t work with Advanced custom fields’ is closed to new replies.