• I want to make wordpress page template with sidebar in wordpress,please tellme how to do that ,I want to make it on

    my website https://myinvestorsnetwork.com,I am using this code ..what what is happening it is now showing sidebar

    with archive …please look at this ..any help would be appreciated

    <?php
    /*
    Template Name: Archives with Content
    */
    ?>

    <?php get_header(); ?>

    <div id=”content” class=”widecolumn”>

    <?php if (have_posts()) : while (have_posts()) : the_post();?>
    <div class=”post”>
    <h2 id=”post-<?php the_ID(); ?>”><?php the_title();?></h2>
    <div class=”entrytext”>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>
    </div>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>

    </div>
    <div id=”main”>

    <?php get_sidebar(‘archive’); ?>

    </div>
    <?php get_footer(); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The code you have at the bottom – <?php get_sidebar('archive'); ?>
    will look for a file named sidebar-archive.php in your template folder.
    Is that file actually there?

    Thread Starter amithak50

    (@amithak50)

    no ..only sidebar.php is there so how to include sidebar with archive ..I am using Genesis theme ,,I get stuck how to include different widget to sidebar ..you can check the live page .. at https://myinvestorsnetwork.com/test/ you can see the page ,as you can see only content footer is showing ..i nwant some sidebar widget too..

    Thanks

    If you would like to include different widgets to the sidebar of the archive page you should use the register_sidebar() function and put it in your functions.php file.

    Put this in your functions.php file –

    register_sidebar(array(
    		'name' => 'Archive Sidebar',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
    		'before_widget' => '<div id="%1$s" class="box %2$s">',
            'after_widget' => '</div>',
        ));

    This will add a widgetized area in your admin panel, called “Archive Sidebar”, you may put there whatever widgets you want to .

    There, in order to show this in the front end in the archive page,
    go to the sidebar.php file and add something like this in the place you want that this sidebar will appear:

    <?php if (is_archive()) {
    		if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Archive Sidebar') ) : ?>
    
    	<?php endif; } ?>

    I looked now in the link you gave and I see you have a sidebar there..

    Btw: how have you made the property search on the right?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘need help in custom template’ is closed to new replies.