- This topic has 7 replies, 3 voices, and was last updated 2 years ago by Fernando.
-
AuthorPosts
-
March 30, 2022 at 5:26 am #2172182Igal
Hi,
I’ve created an element (Page Hero) to serve as the template for my blog posts.
I’ve added dynamic post title, image and dynamic post content blocks.
The title and image works great, since I can disable them.
But the actual content of the post shows up twice (first the dynamic one, than the ‘real’ one)
How do I disable the original post content from showing up like I do with the Title, Featured Image and Primary Post Meta?
March 30, 2022 at 5:42 am #2172200DavidStaffCustomer SupportHi there,
can you share a link to a post where i can see this ?
March 30, 2022 at 11:41 pm #2173188IgalBasically I’m using the Dynamic Content Block – in order to get the post content. But then it’s showing up twice, it’s like the page is pulling the Page Hero template and right after that, it’s pulling the normal WordPress page.
March 31, 2022 at 12:07 am #2173201Fernando Customer SupportHi Igal,
To confirm, are you wanting to remove the default content in your Posts?
If so, try adding this PHP:
add_filter( 'generate_has_default_loop', function( $show ) { if ( is_single() ) { return false; } else { return true; } } );
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
Adding it through Code Snippets should work.
Reference: https://docs.generatepress.com/article/generate_more_jump/
Kindly let us know how it goes. 🙂
March 31, 2022 at 12:33 am #2173223IgalFernando, i’m trying to figure this out:
- GeneratePress has the option of using a Dynamic Post Content block, right?
- That means that by using this block, it will PULL the Post Content (basically all the article except for the title and featured image), and will publish it where ever the block is
- If so, how does it make sense that we need to use a specific PHP code to hide the original WordPress content to avoid duplication?
Again, maybe I’m not clear, but it doesn’t make any sense that you have this option but it order to use it, I need to use some custom code. I’m sure I’m not doing something right and there should be an easy fix for it.
Let me make another example:
- Generatepress has the option to use a dynamic block to PULL the title
- When creating a new element, if I’m not disabling the title, the title would show up twice on the page
- So – it does not make sense to use a custom PHP code to disable the title, since there’s an option to disable it
- Question is – where is this option for the “Post Content” dynamic block?
Hope it’s clear now. It does feel like I’m missing something very simple.
Thanks
March 31, 2022 at 1:43 am #2173286Fernando Customer SupportYou’re not missing anything. 🙂
There is no option to disable the content.
If you wish to use a Dynamic Content Block that displays the Post Content over the content generated by default, another way to do this without any code is through these steps mentioned by David: https://generatepress.com/forums/topic/suggestion-disable-element-full-page-post-content/#post-1549940
For example: https://share.getcloudapp.com/DOu4DdKK
Also see: https://share.getcloudapp.com/9ZumxoyZ
Moreover, usually, the content displayed is the one displayed by default, as opposed to using a Dynamic Content – Post Content Block. The use of this type of Block is case to case.
Hope this clarifies. 🙂
March 31, 2022 at 2:54 am #2173336IgalOk so apparently all I needed to do is change the element type from Page Hero to Content Template… Now it works. Thanks!
March 31, 2022 at 5:12 pm #2174098Fernando Customer SupportI see. Glad you were able to figure it out!
For reference, if you still need it, here is an article with regards to using a Content Template – Block Element: https://docs.generatepress.com/article/block-element-content-template/
Feel free to reach out anytime you’ll need assistance with anything else. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.