In this post i’ll teach you how to create a new custom content box on every edit post screen.
The new meta box enables you to add any type of unique content before your primary sidebar of every post you publish.
Here’s what it looks like on the front end of 1 single post:
And here’s the new box which is added to all your edit post screens:
You can use this solution to:
- Display different adverts on different posts, above the fold.
- Any type of content including videos, text, HTML etc. before your sidebar
There’s only 2 steps you need to follow to add your own mini sidebar:
- Add PHP code to your child themes functions file.
- Create your custom field using the incredible Advanced Custom Fields (ACF) plugin.
Step 1
There’s only 4 lines of PHP code you need to paste at the end of your child themes functions.php file.
No CSS code is needed unless you want to style your custom field differently to what your themes default primary sidebar uses.
Step 2
Once you install the ACF plugin, click to enlarge this image and use exactly the same settings as this screenshot includes.
That’s all you need to do in order to add a new box which enables you to display different content above the sidebar on different posts on your site.
Leave a Reply
You must be logged in to post a comment.