Adding Elements above Masonry layout

Is there a way to add elements above Post Masonry Layout, or create a page in Pro and insert the Post Masonry Layout?

Hey Andrew,

If you’re referring to the Theme’s built-in Blog Layout, that is not possible. But, you can try using the bundled grid plugins as as they have a masonry archive display and you can add a grid using a shortcode or their corresponding elements. Please see the items below:

Hope that helps.

Thanks, I may approach it that way, but I am trying to keep the plugins to a minimum. Is there is not a template page I can add to my child theme just for the masonry layout? I cant seem to find it. I can hardcode in something, it wont be changing once the site is live.

Hi Andrew,

While that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

Instead of editing a template file, you can follow the technique provided here.

With the code provided there, you need to change to 3 things:

First this: x_after_view_global__slider-below
Update that with: x_after_site_begin

More details: X and Pro Specific Actions and Filters

Second this: is_single()
Replace that with: is_home()

More details: Wordpress function is_home()

Third the shortcode: [rev_slider alias="yourslider"]
Replace that with your Global Block shortcode.

Yes, you need to create your custom section as Global Block that way you can edit it like a page content.

Global Blocks

Hope that helps,
Cheers!

Thanks…this is amazing info. I cant seem to get it to show above the masonry layout with is_home(). As a test I have it working on is_single(), and is_front_page(). But for some reason it wont show above masonry with is_single()

Thanks for any additional help.

Hey Andrew,

is_front_page() returns TRUE when the main blog page is being displayed and the Settings > Reading > Your homepage displays is set to “Your latest posts”, or when Settings > Reading > Your homepage displays displays is set to “A static page” and the “Front Page” value is the current Page being displayed. In your case if it’s working then you must have this page set in the settings so is_home() won’t work in this case.

is_single() is for single posts so it won’t work either. To learn more about this you can see https://wordpress.stackexchange.com/questions/30385/when-to-use-is-home-vs-is-front-page

Hope this helps!

Ah, well, that is correct. Settings > Reading > Your homepage displays displays is set to “A static page” and the “Front Page” value is the “Home Page” i created with pro.

So if is_home() wont work, and is_single() wont work, and…modifying a template wont work, then I guess I am stuck with installing grid! Bummer.

Thanks tho, i have learned a lot.

Hi @coloradodesigngroup,

You can try is_front_page() instead.

https://codex.wordpress.org/Function_Reference/is_front_page
https://developer.wordpress.org/reference/functions/is_front_page/

Thanks

Thanks…but that just puts it on the homepage, and I need to keep the homepage display to static page.

Hi Andrew,

Did you try the is_home()? Did you follow the documentation I provided above?

  • On the page assigned to display the blog posts index:
  • is_front_page() will return false
  • is_home() will return true

That means the is_home() is the one that you need to use. If that did not work for some reason, please do testing for a plugin conflict. You can do this by deactivating all third-party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes,
Cheers!

Thanks again. I disabled plugins, change to default pro theme, removed all css, and its still not showing. Not sure why.

is_home() does nothing
is_front_page() loads global block on home page

anyway…I may just use the first method, Grid or Essential Grid, i hate to keep bothering you guys with this as it is in the customization realm. Thanks for trying, i really do appreciate all your awesome support. Pro is my go to theme from here on out. :slight_smile:

Hi Andrew,

Wait, did you not enable the child theme?

Please enable the child theme.

Now I realize you want it above Post Masonry Layout

Try replacing this x_after_site_begin back to x_after_view_global__slider-below

If that did not work still, yup you can use the Grid or Essential Grid :wink:

Cheers!

yes, i just changed to default pro for testing. I always use the child theme! :slight_smile:

Ill try that, although I already rebuilt in The Grid.

Thanks

ha! that did it. Thanks so much.

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.