Hi, I want to edit my sidebar and want to insert this code to show specific category posts in sidebar
This is code is working fine in my theme. And I want to add this to my sidebar.php but when I opened sidebar it shows like this
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
I looked in to function.php but nothing helped me but i found this code there
Any help to insert that code in my sidebar so it will be show on all pages in sidebar.
waiting for your kind response
What theme are you using?
You don’t need to edit your functions.php file. You’ll want to find a template file in your theme called sidebar.php. It should have code kind of like this:
<?php if ( is_sidebar_active('primary-widget-area') ) : ?> <div id="primary" class="widget-area"> <ul class="xoxo"> <?php dynamic_sidebar('primary-widget-area'); ?> </ul> </div><!-- #primary .widget-area --> <?php endif; ?>
Then you’ll want to add your code above or below the part that pulls in the sidebar widget. Like this:
Hope this works for you.
Hi David, Thanks for your reply, As I told you that I have only below code in sidebar.php
<div id="sidebar" class="grid4"> <?php dynamic_sidebar( 'sidebar' ) ?> </div>
Its nothing else there in sidebar.php.
And when I put some new code in sidebar.php its showing nothing, Now tell me how can I add something there.
Waiting for your kind reply
- The topic ‘I want to edit my sidebar.php by fail (Help me)’ is closed to new replies.