Is it possible to create a page for a particular event that doesn’t follow the overriding theme style? I want my site to host bookings for an event without my site’s branding.
Michael Docker
Creating a template single-event-{event-slug}.php
in your theme (replacing {event-slug}
with the slug of the event should allow you to customise the page displayed for a single event. (You can use the example in templates/single-event.php
as inspiration).
That template file should be responsible for rendering the page, so in theory you can set the entire HTML markup of the page however you want. In practise you would typically use get_header()
and get_footer()
which include the theme’s header and footer, and which almost certainly contain things like menus and ‘brand’ image/text, along with loading stylesheets all associated with your theme.
So you may find you have to reproduce your own header/footer – but you will still need to call wp_head()
and wp_footer()
appropriately in your template which themselves load theme/plugin styles. To get around any undesired effects that may have on the look of the page, you may just have to add further styling to over-ride the theme on that particular page.
Your theme will hopefully insert classes into the <body>
tag which would allow you to target an event with a specific ID or slug.
Stephen Harris
Thank you for your prompt and detailed response. I’ll give that a go.
Michael Docker