Are the banners related to each page? If so, I would use a custom field or just a metabox that the user could edit or enter information into on the page that you want the banner to show up. The field would show up below the content in the page editor. You would then in your single.php add the code you noted above to encase whatever is typed in the custom field.
If the banners are NOT related to individual pages. I would make a custom post type “banners” and then have them randomly show up on pages by inserting a call for the CPT within the single.php.
You can either use a plugin to create the fields or these reference links will help you get started on creating your own:
https://codex.wordpress.org/Plugin_API/Action_Reference/add_meta_boxes
(explanation etc)
https://developer.wordpress.org/reference/functions/add_meta_box/ (code examples and usage)
Related Posts:
- Selecting An image from the Media LIbrary on the frontend
- How to disable page delete
- get_pages() not ordering as it should
- How to customize the default HTML for WordPress Attachments
- Editing the Number at the end of Page URLs / Editing Page Slugs
- Pagination Help on Crazy Custom Authors Page
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- Hide page title in WordPress 3.0
- Custom protected password page with ACF
- Page load requires a trailing “/” [closed]
- Virtual Pages plugins
- Programmatically add a custom page/path/url/route to WordPress
- How to merge all my pages into one, while keeping a menu bar?
- How to change URL Custom Page?
- redirect product-category to a custom page
- custom headers for static home page and posts page
- Show posts on a page based on a category and tag(s)
- Split Conference WordPress Page in different years
- Publishing html directly from ftp to wordpress
- Add google org chart to wordpress page
- How to get custom page template being edited in gutenberg editor
- How do I change the markup only of a built-in widget?
- Is it possible to add a ribbon in the background of h1 on every page?
- Control Content On Non-Blog Pages
- Edit sticky header html – How to locate corresponding php file
- custom meta box for page default template
- Best practice – pages – ACF or inline coding
- How to hook up search results page to a back-end page?
- How to structure model showcase
- How can I have a common background color across multiple WordPress blocks?
- How to customize
- Add a searchbox to the body of a page
- Create page as a file in my theme?
- Featured Image If Else Condition
- “woocommerce_form_field()” function having issues after latest woocommerce update [closed]
- Insert menu with a custom walker into page / post body using shortcode?
- How to create “custom page types” with different custom fields in them?
- How to create custom search page
- How do I hide an article element so only logged out users see it
- Creating php pages in wordpress and assigning them to wordpress pages
- Upload a web module (html and JS) to wordpress
- How to display page ids as page slug names?
- How to create custom layouts and static pages in themes for clients
- How to make the Pages in WordPress Customized?
- Creating custom page template
- Change Site Logo or Menu Logo Per Page
- change top banner content on specific page
- How to add page content into another page
- Display a specified content on a Page and all its child pages
- Custom CSS Nav Menu Style Not Being Applied
- Easily add custom HTML outside the main container?
- Use a custom page with dynamic content as a user profile page
- I want to embed mystream video in my wordpress site
- Add producthunt badge to wordpress menu
- Swap home page based on user role, Elementor layout breaking
- Taxonomy template is not reading
- New Page/Post Screen Opens an Existing Post
- Static Page, need Last and Next links at the bottom
- How can I create a Custom Page? (not a page template!!)
- how to add custom html and css to wordpress
- wordpress custom posts page not showing
- How to serve an already coded html page in a WP page, to assign a simpler url
- Move text from the side of image to below image [closed]
- WooCommerce – Adding custom HTML to specific product pages
- Admin menu disable new/delete page
- Show different pages on site depending on user choice
- Accept HTML in custom function
- WordPress post submit page
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Allow arbitrary text after page URL
- Best way to create a page outside of the pages list
- Want home page to click through to two different page types
- Custom single page based on which custom page template is selected
- How to duplicate “Pages” section in the control panel?
- Page template with custom html fields inside a content
- Pass query param to custom page
- Adding Custom HTML/CSS/JS code in specific page
- Making custom pages (with an example to explain the goal)
- How to create a shortcode with HTML code in it and custom parameters/
- how can i change the html and the css of my word press theme that I bought?
- Is there a way to have information on one page automatically feed into another? [closed]
- how to add a page
- adding new html css to wordpress section from codepen [closed]
- How to apply styles to the custom page template
- How can I make a search term redirect to a page
- Custom CSS working on home page but not on NEW created PAGE
- Create a page for each database table entries
- How to use standalone Gutenberg (block editor) instance on any my own admin page in WordPress
- Custom jQuery code in Elementor page is not working on Mac os. On Windows browser work fine
- Block Theme: How to use a different template on front page vs paginated pages?
- How to customize the WordPress 2014 theme, to have page using less horizontal margin?
- WordPress Child Theme Stylesheet being loaded before Parent’s minified .css
- Open “Visit site” in a new window?
- get_template_directory_uri() not working
- How do I change the element using a custom function?
- Allow multisite admins only to create users with one specific user role?
- Where to store reusable content that is not a page
- Add or Create Custom Structure Tags to Permalink
- How to edit alternate inactive themes in “Appearance -> Customise” screen?
- Prevent Multisite from creating sample page, sample post and sample comments