Community Forums › Forums › Archived Forums › General Discussion › Need a genesis guru to chime in on conditional statements
Tagged: conditional statement
- This topic has 11 replies, 4 voices, and was last updated 6 years, 10 months ago by Bill.
-
AuthorPosts
-
June 16, 2017 at 5:34 pm #207849BillParticipant
This request is not easy I dont think....but here it goes....
I run a real estate website. My idx plugin (the plugin that provides property listings) creates the property pages dynamically. (there is no wordpress page template, and no wordpress published pages for these) At set up, The IDX plugin allows you to choose a word to use in the url string (for example, "properties"), and then from that point forward... ALL IDX pages are served up dynamically using a url string like this: http://www.websitename.com/properties/listing/mfr/A4173282. or similar
(there is no actual page created in wordpress...its done dynamically using ajax and other things beyond my knowledge.)SO, my site is set up to content-sidebar. However, I want to use full width pages on these idx pages (which, again, are only server up dynamically). I am REALLY hoping there is some sort of conditional way to target the url to force a full width... such as....if the site has a url string of http://www.websitename.com/properties(Then wildcard after that)...it will serve up a conditional like this one:
/** Force full width layout on Showcase idx pages*/ add_filter( 'genesis_site_layout', 'idx_cpt_layout' ); // Force a layout function idx_cpt_layout() { if (is_page( 'properties' )) { return 'full-width-content'; } }
I realize this one targets a page called "properties", and would work, however, the properties page actually doesn't exist. THe only thing that would be consistent and possibly be able to be targeted is the url string of "www.websitename.com/properties/****"
Is there ANY way genesis can serve up a full width on a url string???
June 17, 2017 at 9:48 am #207861Victor FontModeratorAll pages in WordPress are served dynamically because all content is stored in the database. Publishing a page does not create a physical page. It only tells WordPress that the content can be served up dynamically.
Please post a link to the site's properties page so we can view the source code. You post, while descriptive of the problem, doesn't provide the details needed to solve your requirement.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 17, 2017 at 9:55 am #207865BillParticipantThank you.
Yes, I understand, but what I meant is that there is a wordpress page created already, so its east to target with conditional statements. THe property lsitings do not have pages created in wordpress, so conditonal targeting is challenging. There is not even a page template to target.Here is the search result grid where homes are listed. This is an actual wordpress page I have set to show the search results for this particular small town. I have many of these pages in wordpress, with the shortcode used by the IDX plugin to pull in the appropriate properties for that particular page's area.
This however, is one example listing from that grid. There is no existing wordpress page for this. The plugin created this page. If you notice every listing has the same beginning url to the the word "properties". Iw ant to see if there is a filter or statement available to target a url structure, and serve up a full width page in genesis for that url structure.
June 17, 2017 at 10:16 am #207870Victor FontModeratorAre the property listings saved on your site or are they accessed through an API from the IDX site? The reason I ask because if they are saved on your site, a custom field might do the trick.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 17, 2017 at 10:19 am #207871BillParticipantthey are not on my site
June 17, 2017 at 10:20 am #207872Victor FontModeratorOne alternative might be the PHP $_GET array. Since you are clicking a link, the URL should be getting passed back to the site through the $_GET object. You could scan the appropriate element for the word properties.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 17, 2017 at 10:24 am #207873BillParticipantThanks, ...but I have no idea how to do that.
I discussed this with the plugin developer, but they are not genesis people... I was hoping genesis has some magic filter 😉 that would allow for forcing full width on a url string. I wouldn’t know how to do what you are talking about.June 18, 2017 at 6:49 am #207885Andrea RennickMemberYou're getting data from a URL String - this isn't genesis at all.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
June 18, 2017 at 7:04 am #207895BillParticipantHi Andrea! yes, I know the data is coming from the plugin....I am just curious if there is a creative way to somehow target these IDX pages somehow to force a full width just on these idx pages. I didn't think there was, I do know how to do WP conditional statements, but there is really nothing to target. The plugin uses ajax to populate the listings on a page it creates itself. (no dedicated wordpress page)
I DO have the option to dedicate a wordpress page for the idx plugin to use instead, which would solve the problem as I can easily target a page in genesis to force full width for that page....but the MAJOR issue I see in doing that is that the H1 tag will always be the name of that one page I created, and not the property address of the listings. If I don't create my own dedicated page for the idx plugin to use, the plugin gets it right and uses the property listing address as the H1 tag....which is how it should be for seo reasons. But if I had created a blank page called PROPERTIES for the idx plugin to use to display the listings on, every single property listing page will be served up on that same PROPERTIES page I created, and will have the same H1 tag called, say PROPERTIES. I know that is NOT good for seo.
So, on one hand, if I don't create a dedicated page in wordpress to display the properties on, the plugin created its own and uses the property address as the H1 tag...all is good...EXCEPT it takes on content-sidebar because that is what Genesis is set to by default... but if I really want full width pages for listings, I CAN create the page manually to be used by the plugin to display idx listings, and I can easily set that as full width, but then the H1 tag will always be the name of that one page I created....regardless what listing is displayed....bad for seo
...so that is my problem. I was just wondering if there was any crazy way to target a url string and force a full width layout based on the url string starting with websitename.com/properties/*****
June 18, 2017 at 12:48 pm #207905IDX LeadsMemberYou might be better served by an IDX provider that makes presentation of filtered results more customizable. IDX Broker comes to mind.
Esse quam videri
June 19, 2017 at 4:47 am #207924Victor FontModeratorAs Andrea said, reading a URL has nothing to do with Genesis. Nevertheless, I wrote a function for you that will do what you want. I've tested this on my local site with the Genesis Sample Theme:
add_filter( 'genesis_site_layout', 'idx_cpt_layout' ); function idx_cpt_layout() { if ( strpos( $_SERVER['REQUEST_URI'], "properties" ) ) { return 'full-width-content'; } }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?June 19, 2017 at 5:38 am #207927BillParticipantVictor,
That was exactly what I needed! Thank you so much for taking the time to do that.
Very much appreciated!!! -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.