Custom sidebar for Create Listing page without plugins
I've always wanted to have a sidebar on my create-listing page where I could add few text widgets with instructions for business owners on filling out the submission form.
I know some of you want to add your own sidebar on that page too, and you can do it with the help of plugins, but here's a little tutorial on how to achieve that with only minor modifications to the code (kudos to
overserv for mentioning this method, but I figured I would do a step-by-step tutorial also).
1. You need to register a new sidebar.
Open your
core.php file and find line 194, where all sidebars are listed. Add this line after the last registered sidebar
PHP Code:
va_register_sidebar( 'create-listing', __( 'Create Listing Sidebar', APP_TD ), __( 'The sidebar for Create Listing Form', APP_TD ) );
That will create a new sidebar called "Create Listing Sidebar" that you can now see in your backend admin under Appearance > Widgets
create_listing_sidebar.jpg
2. Add a sidebar to Create Listing page
Open the
form-listing.php and add this at the very end (after </div><!-- #content -->)
PHP Code:
<div id="sidebar">
<?php dynamic_sidebar( 'create-listing' ); ?>
</div>
Now you should have your own sidebar for that page. I added a few text widgets explaining each section of the submission form to help with the process.
create_listing_page.jpg