Archived topic
dynamic pages and page elements
11 replies · Started by Shannon on March 3, 2023
I used the driver template from the site library and am trying to create a few different page headers. My website also has an IDX plugin which creates dynamic pages in wordpress. See an explanation here: https://kb.ihomefinder.com/s/article/idx-pages
What is the best way to apply or exclude a page header from the different dynamic pages as well as the rest of the website? I keep encountering unexpected issues with the page headers, either it's duplicated or missing or an unintended one is applied and I believe this is caused by the dynamic pages.
Hi there,
The username doesn't work, can you check?
sorry I just redid it and verified that the login info i sent in the private area works
I logged in successfully this time :)
Can you show me an example where I can see the page header doesn't work?
When there is only page hero block applied to the entire site then this dynamic page https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442
Displays the page hero block but without a title
But when I add an exclusion for just one page then the page hero block disappears from the dynamic pages
https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442
Then if I add a second page hero block and apply it to only one page then it applies it to the dynamic pages but the spacing is different on dynamic pages than the page it is applied to.
https://www.staging5.homesforsalegreenbay.com/schedule-appointment/
I hope that makes sense. You can edit the inclusions and exclusions on the page hero blocks to see what I mean
Hi Shannon,
To clarify, are you wanting the Page Hero "Slim Page Header" to appear on this custom dynamic page?: https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442
If you don't want it to appear, we can try to remove it through custom PHP. See here: https://docs.generatepress.com/article/generate_element_display/
Example code:
add_filter( 'generate_element_display', function( $display, $element_id ) {
if ( 9295 === $element_id && is_page( array( 0 ) ) ) {
$display = false;
}
return $display;
}, 10, 2 );
Also, in terms of the title of these dynamic pages not appearing on the Page Hero, your plugin may be adding the titles differently than usual.
I would like to be able to control which page headers appear on which pages. It would be fine if the slim page header appeared or better yet if I could make a new header just for the dynamic pages. I tried adding the example code in your post, not sure if I did it correctly. The page header on the dynamic pages don't look any different (the spacing is wrong) and now the home page and other pages have duplicate page headers https://www.staging5.homesforsalegreenbay.com/ & https://www.staging5.homesforsalegreenbay.com/contact/
spacing is missing
https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442
compared to
https://www.staging5.homesforsalegreenbay.com/schedule-appointment/
I edited the code above. Can you update yours? That code will disable the Page Hero you have for this page: https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442
You can then create a new Page Hero with a static Title for that page.
I copied and pasted the code snippet. It got rid of the duplicate page heros on the other pages. The page hero still appears on this page https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442 and it is still missing the spacing that it should have like on this page https://www.staging5.homesforsalegreenbay.com/schedule-appointment/
I see. To clarify, do you just want to add the spacing or a title as well for this page?: https://www.staging5.homesforsalegreenbay.com/homes-for-sale-search/?cityId=25452&bedrooms=0&bathCount=0&propertyType=CND&propertyType=SFR&status=active&sort=priceDesc&boardId=442
probably just the spacing. I don't know that a title is necessary.
I see. Can you remove the PHP snippet I recommended?
Then, add a 252.4px min-height to the Container Block holding the Headline Block in your Block Element.
Reference: https://docs.generateblocks.com/article/sizing-options-overview/