Change html conditionally, per page
-
I need to adjust a couple of html tags depending on the page the book tables show on. For example, I want to change the h2 tag for the book titles to h3 tags for a list of books showing on the home page (added via the shortcode). I try conditionally to change via is_front_page and nothing happens. Specifcally, I notice that trying to query the page id, keeps returning 0 when trying to use
get_the_ID
or if usingglobal $wp_query;$post_id = $wp_query->get_queried_object_id();
, returns the id of the book term. It seems that all the templates are inside a query. Is there a work around?
My site is not live yet so I can’t share an link.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Change html conditionally, per page’ is closed to new replies.