I have a client with 4 very specific areas of service and they want so show the service name under the site logo but only the pages related to that service. E.G. the Real Estate page and ALL of its child pages will have “REAL ESTATE” appear beneath the site logo. There are four different services currently. Some pages will be generic (Contact, About, etc) which will not need this treatment.
How do I accomplish this? I don’t need to replace the site tagline specifically, but that’s the best description for where this text should visually appear. (could also be the page header, as the background colors are the same) Thank you.
I have a client with 4 very specific areas of service and they want so show the service name under the site logo but only the pages related to that service. E.G. the Real Estate page and ALL of its child pages will have “REAL ESTATE” appear beneath the site logo. There are four different services currently. Some pages will be generic (Contact, About, etc) which will not need this treatment.
How do I accomplish this? I don’t need to replace the site tagline specifically, but that’s the best description for where this text should visually appear. (could also be the page header, as the background colors are the same) Thank you.
Share Improve this question asked Nov 20, 2019 at 23:43 Sarah HSarah H 111 bronze badge1 Answer
Reset to default 1If I understand the question, you'd like the code to detect the service area that the page is addressing, and place in the relevant tagline/phrase under the logo, on that page.
Presuming you are able to modify the php code for the page header template section that displays the logo and tagline, you could set up code to echo the desired tagline under the logo, dependent on some variable.
One way to do this would be to define a custom field in the site's pages named, say, service_area, and give this field the value of 'real estate' or 'retail' etc. Then, before the tagline, in the template, do a callback to capture the value of the service_area custom field for that page.
With that service_area value, a php switch function would define the tagline, dependent on the service_area value, the default being the default tagline for the site.
Perhaps, even simpler, the custom field (service_area in this example) value, itself, could be the tagline. If the value is empty or null, the tagline reverts to the default tagline for the site.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744985076a4604562.html
评论列表(0条)