Czerpanie wpisów z innego miejsca
-
Witam Wszystkich serdecznie,
mam następujący problem. Poniżej przedstawiam Wam pełny kod szablonu, który czerpie wpisy (posty) ze specjalnie założonego przez autora działu „Portfolio”. Chciałbym, aby ten szablon czerpał jednak posty z głównego miejsca wordpressa, jakim są „Wpisy”. Jak to zrobić? Obrazowo przedstawiam to jeszcze na załączonym screenie:
http://www.ankal.pl/szablon.jpg<?php /* Template Name: Template - Portfolio Home */ ?> <?php get_header(); // add header ?> <div id="content"> <ul class="filter"> <li class="selected filterimg"><a href="#" rel="all" title="Zobacz wszystko" >Wszystko</a></li> <?php $catz = get_terms('portfolio2', 'orderby=count&hide_empty=1'); foreach($catz as $cat1){ echo '<li><a href="#" rel="'.$cat1->slug.'" title="View all items under '.$cat1->name.'"><span>/</span>'.$cat1->name.'</a></li>'; } ?> </ul><!-- end filter --> <div class="clear"></div> <?php $nrprojects = of_get_option('iuliann_portfolio_home_number'); $args = array( 'post_type' => 'portfolio', 'post_status' => 'publish', 'posts_per_page' => $nrprojects, 'ignore_sticky_posts' => 1, ); query_posts($args); while (have_posts()): the_post(); $catz = wp_get_object_terms($post->ID,'portfolio2'); foreach($catz as $cat1) { $itemcat = $cat1->slug; break; } // Custom post type and get the category ?> <ul class="item"> <li rel="<?php echo $itemcat; ?>"> <div class="post-portfolio"> <div class="entry-post"> <?php if ( has_post_thumbnail()) { ?> <a href="<?php the_permalink() ?>"> <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_image_path($post->ID); ?>&w=244&h=150" alt="<?php the_title(); ?>" /> </a> <?php } else { ?> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <img src="<?php bloginfo('template_directory'); ?>/images/noimg-posts.png" width="244" height="150" alt="<?php the_title(); ?>" /> </a> <?php } ?> <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php echo substr(the_title('', '', FALSE), 0, 40) . ' . .'; ?></a></h2> <p><?php truncate_post(70, true);?></p> <div class="entry-meta"> <?php the_time('j F Y'); ?> <span>·</span> <?php comments_popup_link('Brak komentarzy', '1 komentarz', '2 komentarze', '3 komentarze', '4 komentarze', '% komentarzy' ); ?> </div><!-- end entry-meta --> <div class="sright"><a href="<?php the_permalink() ?>" class="read_more"></a></div> </div><!-- end entry-post --> </div><!-- end #post --> </li> </ul><!-- end item --> <?php endwhile; ?> <div class="clear"></div> </div><!-- end content --> <?php get_footer(); // add footer ?>
- Temat ‘Czerpanie wpisów z innego miejsca’ jest zamknięty na nowe odpowiedzi.