• Resolved acmdesigns

    (@acmdesigns)


    I’ve selected Posts from the Post type dropdown and “Recipes” from the Category dropdown, but the plugin doesn’t seem to respect this setting and shows posts from other categories. Is there something I’m doing wrong here? I’m using the shortcode within a php template file.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tako

    (@razzu)

    Hello,

    please update shortcode after making changes then yu will see new updated Shortcode, and use it .

    Thanks

    Thread Starter acmdesigns

    (@acmdesigns)

    Ah ok, I didn’t know there was a shortcode attribute sm_category_name — had to dig through your code, because it wasn’t being set in the shortcode field. There seems to be a bug in your plugin.

    In class.siple.masonry.admin.php line 156-162, the sm_category_name attribute only gets set if the $sm_post_type and $sm_as_gallery is set. This means if you have Use as Masonry Layout Gallery disabled, it will never add category the attribute to shortcode in the admin UI. I had to manually add the attribute in my shortcode and it started filtering by the category I specified.

    I don’t see any other place in your code where sm_category_name is set.

    Original code Line 156-162:

    if ($sm_post_type && $sm_as_gallery) {
        $shortcode_atts['gallery'] = 'yes';
    
        if ($sm_category !== 'none') {
            $shortcode_atts['sm_category_name'] = $sm_category;
        }
    }

    Updated code:

    if ($sm_as_gallery) {
        $shortcode_atts['gallery'] = 'yes';
    }
    
    if ($sm_post_type && $sm_category !== 'none') {
        $shortcode_atts['sm_category_name'] = $sm_category;
    }

    On an unrelated note, I’m not sure if I’m doing something wrong here, or it’s a conflict with my theme CSS, but It’s only showing 2 columns with a lot of space on the right instead of 3. I assume it’s either some configuration that I missed or some CSS or HTML that’s causing it to push the 3rd column down to the next row. Maybe it’s not wide enough. I’ve been digging through the HTML and CSS for a bit and haven’t found anything yet. Any suggestions?

    • This reply was modified 2 years, 8 months ago by acmdesigns.
    Plugin Author Tako

    (@razzu)

    Thanks buddy, it’s my bad, i have hotfix it.
    But about 2 columns, it’s may be because of theme’s css.

    Cheers 🙂

    Thread Starter acmdesigns

    (@acmdesigns)

    Well, I’m not sure if it’s my theme either. I tried the stock Twenty Twenty Three theme and get the same result. Is there a setting I’m unaware of? I’ll try to see if there are any other plugins that can be causing this, but any help is appreciated.

    Thread Starter acmdesigns

    (@acmdesigns)

    I also thought maybe it was allowing room for the sidebar, but that’s not the case. It wasn’t showing the sidebar and when I enabled it, it made it smaller to accommodate the sidebar and still left an empty space where the 3rd column should be.

    Thread Starter acmdesigns

    (@acmdesigns)

    I figured out the column layout issue. The problem was 33.3%, 50% and 100% widths in .sm-grid .grid-sm-boxes-in weren’t fitting for some reason. Reducing the widths to 32% for 3 columns and 47% for 2 columns fixed it, but that’s obviously not an ideal solution. After digging more, the following CSS resolved it:

    *, :after, :before {
    	box-sizing: inherit;
    }

    Might want to consider including this in your plugin’s CSS as it seems to be necessary for the columns widths to be sized correctly.

    Plugin Author Tako

    (@razzu)

    I appreciate your feedback, and I will definitely take it into consideration. If you encounter any further issues or have additional questions, please don’t hesitate to reach out to us via email at [email protected]. Thank you for bringing this problem with my plugin to my attention.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘layout doesn’t respect Category setting’ is closed to new replies.