رفتن به مطلب

aliap

عضو سایت
  • تعداد ارسال‌ها

    9
  • تاریخ عضویت

  • آخرین بازدید

نوشته‌ها ارسال شده توسط aliap

  1. خلاصه مطلب و تصویر را داخل یک div قرار دهید

    و به div استایل دهید

    طبق راهنمای بالا

    ممنون

    من الان از این کد دارم استفاده میکنم


    <div id="gridcontainer">
    <?php
    $counter = 1; //start counter
    $grids = 2; //Grids per row
    global $query_string; //Need this to make pagination work

    /*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */
    query_posts($query_string . '&caller_get_posts=1&posts_per_page=12');

    if(have_posts()) : while(have_posts()) : the_post();
    ?>
    <?php
    //Show the left hand side column
    if($counter == 1) :
    ?>
    <div class="griditemleft">
    <div class="postimage">
    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a>
    </div>
    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    </div>
    <?php
    //Show the right hand side column
    elseif($counter == $grids) :
    ?>
    <div class="griditemright">
    <div class="postimage">
    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a>
    </div>
    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    </div>
    <div class="clear"></div>
    <?php
    $counter = 0;
    endif;
    ?>
    <?php
    $counter++;
    endwhile;
    //Pagination can go here if you want it.
    endif;
    ?>
    </div>

    و css هم


    #gridcontainer{margin: 20px 0; width: 100%; }
    #gridcontainer h2 a{color: #77787a; font-size: 13px;}
    #gridcontainer .griditemleft{float: left; width: 278px; margin: 0 40px 40px 0;}
    #gridcontainer .griditemright{float: left; width: 278px;}
    #gridcontainer .postimage{margin: 0 0 10px 0;}

    حالا میخوام پست های category خاصی رو نشون بدم، ممنون میشم راهنمایی کنید.

  2. متاسفانه فعلا دارم در کامپیوتر کار میکنم تا قالب اول ساخته شه.

    post-4843-0-30675400-1393275202_thumb.jp

    اینم کد صفحه اصلی


    <?php
    /**
    * The main template file
    *
    * This is the most generic template file in a WordPress theme and one of the
    * two required files for a theme (the other being style.css).
    * It is used to display a page when nothing more specific matches a query.
    * For example, it puts together the home page when no home.php file exists.
    *
    * @link http://codex.wordpress.org/Template_Hierarchy
    *
    * @package WordPress
    * @subpackage Twenty_Thirteen
    * @since Twenty Thirteen 1.0
    */
    get_header(); ?>
    <div id="primary" class="content-area">
    <div id="content" class="site-content" role="main" style="float : right;">
    <?php $recent = new WP_Query("cat=2&showposts=5");
    while($recent->have_posts())
    : $recent->the_post();?>
    <?php the_post_thumbnail('medium'); ?><br />
    <a href="<?php the_permalink() ?>"><?php the_title(); ?></a><br />
    <p><?php the_excerpt_rss( 1000, 1 ); ?></p>
    <?php endwhile; ?>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

×
×
  • اضافه کردن...