• mghx

    (@mghx)


    hi everyone. I am just nedded a second portfolio in my website. Because of that i copied portfolio but i coulnt find the code which is showing posts.
    I am just wanting new portfolio page shows postfolio category 1 of posts 120 and 121. here is my portfolio code:
    <?php
    /**
    * The main template file.
    * Template Name: 3_columns_portfolio2
    *

    */

    get_header(); ?>
    <?php include(TEMPLATEPATH . ‘/inc/data.php’); ?>
    <section id=”content”>
    <div class=”container_12 top0″>
    <div class=”drop-shadow”>
    <div class=”grid_12 slogan” style=”margin-top:0;”>
    <div class=”slogan-inner clearfix”>
    <div class=”grid_9″>
    <div class=”slogan-title”><?php the_title(); ?></div>
    <div class=”slogan-text”>
    <?php if ( function_exists(‘yoast_breadcrumb’) ) {
    yoast_breadcrumb(‘<div id=”breadcrumbs”>’,'</div>’);
    } ?>
    </div>
    </div>
    <div class=”grid_3″>
    <?php if (get_option(‘feedback_button_text’) && $feed_link = get_option(‘feedback_button_link’)) {?>
    ” class=”link-1″><?php echo get_option(‘feedback_button_text’) ?>
    <?php } ?>
    </div>
    </div>
    </div>
    <div class=”clear”></div>
    </div>
    <div class=”clear”>
    </div>
    <div class=”grid_12″ style=”margin-top:-20px;margin-bottom:24px;”>
    <?php afl_pager($posts_count, $per_page, $paged); ?>
    <div class=”clear”></div>
    <div class=”divider” style=”margin-top:20px;”></div>
    </div>
    <div class=”clear”></div>
    <div class=”grid_12″>
    <?php
    global $post;

    $col=’first’;
    $tmp_post = $post;
    $max_page = ceil(floatval($posts_count)/$per_page);
    $per_page = get_option(‘posts_per_page’);
    $posts_count = wp_count_posts(‘portfolio’)->publish;
    $paged = intval(get_query_var(‘paged’));
    if(empty($paged) || $paged == 0) $paged = 1;
    $args = array( ‘posts_per_page’ => $per_page, ‘offset’=> ($paged-1)*$per_page, ‘post_type’ => ‘portfolio’ );
    $myposts = get_posts( $args );

    foreach( $myposts as $post ) : setup_postdata($post);
    $i++;
    $j++;
    if ($col == ‘first’)
    echo ‘<div class=”clearfix”>’;

    ?>
    <div class=”bottom20 grid_4 post_<?php echo $post->ID; if ($col == ‘first’) echo ‘ alpha’; else if ($col == ‘last’) echo ‘ omega’ ?>” id=”post-<?php echo $post->ID; ?>”>
    <div class=”portfolio portfolio3-item”>
    <?php $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘full’);?>
    <?php if (has_post_thumbnail()) { ?>
    <div class=”drop-shadow img-box”>
    <div>
    ” rel=”prettyPhoto” class=”portfolio-img” title=”<?php echo $post->post_title ?>”><?php the_post_thumbnail(‘portfolio_3_column’); ?>
    </div>
    </div>
    <?php } ?>
    <div class=”entry”>
    <?php the_excerpt(); ?>
    </div>
    </div>
    </div>
    <?php

    switch ($col){
    case ‘last’:$i=0;if ($j != $per_page) echo ‘</div>’;$col=’first’;break;
    case ‘second’:$col=’last’;break;
    case ‘first’:$col=’second’;break;
    }
    if ($j == $per_page) echo ‘</div>’;
    ?>
    <?php endforeach; ?>
    <?php if ($paged == $max_page) {echo ‘</div>’;}?>
    <div class=”grid_12 top10 alpha omega”>
    <div class=”divider” style=”margin-bottom:20px;”></div>
    <?php afl_pager($posts_count, $per_page, $paged); ?>

    </div>
    <div class=”clear”></div>

    </div>
    </div>
    <div class=”clear”></div>
    </section>

    <?php get_footer(); ?>

  • The topic ‘multiple template’ is closed to new replies.