Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1544

    Hello,

    I want to keep the sidebar on the portfolio page but i haven’t find the way to do it on the “portfolio template”

    Note : I change the size and the number of collum to just have two collum of images.

    #35600

    After a lot of test this code seem to work :

    <?php

    /*

    Template Name: Portfolio

    */

    global $k_options;

    get_header();

    $teaser = get_post_meta($post->ID, “teaser”, true);

    if($teaser != “”){ ?>

    <div class=”additional_info”>

    <h2><?php echo $teaser; ?></h2>

    </div>

    <?php }

    $more = 0;

    $posts_per_page = $k_options;

    $query_string =”posts_per_page=”.$posts_per_page;

    $query_string .= “&cat=”.$k_options[$post->ID].”&paged=$paged”;

    query_posts($query_string);

    echo ‘<div id=”main”> ‘;

    echo ‘<div class=”wrapper”>';

    get_sidebar();

    echo ‘<div class=”box box_medium box1″>';

    $boxnumber = 1;

    if (have_posts()) : while (have_posts()) : the_post();

    $portfolio_image = get_post_meta($post->ID, “frontpage-image”, true);

    $portfolio_image_small= get_post_meta($post->ID, “frontpage-image-small”, true);

    if($portfolio_image != “” && $k_options == 1)

    {

    $resizepath = get_bloginfo(‘template_url’).”/timthumb.php?src=”; #timthumb path

    $resize_options1 = “&w=280&h=140&zc=1″;

    $portfolio_image_small = $resizepath.$portfolio_image.$resize_options1;

    }

    if($portfolio_image_small != “”){

    if ($boxnumber == 1) echo ”; ?>

    <div class=”portfoliobox box_small2 box box<?php echo $boxnumber; ?>”>

    <h4 id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></h4>

    <?php

    echo ‘‘;

    ?>

    </div><!–end box_small–>

    <?php if ($boxnumber == 2) echo ”; ?>

    <?php

    $boxnumber = $boxnumber == 2 ? ‘1’ : $boxnumber + 1;

    }

    endwhile;

    echo”</div><div class=’entry’>”;

    kriesi_pagination($query_string);

    echo'</div>';

    else: ?>

    <div class=”entry”>

    <h2>Aucune page</h2>

    <p>Désolé, aucune page ne correspond à votre recherche.</p>

    </div>

    <!–do not delete–>

    <?php endif;

    if($boxnumber != 1){

    echo ”;

    }

    get_footer(); ?>

    #35601

    Glad that you sorted it out.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Get the sidebar on portfolio page’ is closed to new replies.