loop items on page

Discussion in 'Squirrel WordPress Theme' started by marialberti, May 17, 2014.

  1. marialberti

    marialberti New Member

    Joined:
    Jul 22, 2013
    Messages:
    8
    Likes Received:
    0
    I want to create a page with text and loop items.
    I created a new page template but it does not work.
    What did I do wrong?

    <?php
    /*
    Template Name: PRIME
    */
    ?>
    <?php get_header(); ?>
    <div class="clear"></div>
    <div class="page-content">
    <div class="grid_16 alpha">
    <div class="content-bar">
    <?php if (have_posts()) : the_post(); ?>
    <h1 class="page_title"><?php the_title(); ?></h1>
    <?php the_content(); ?>
    <?php endif; ?>
    <!--Start Post-->
    <?php get_template_part('loop', 'prime'); ?>
    <!--End Post-->

    <div class="clear"></div>
    <nav id="nav-single"> <span class="nav-previous">
    <?php next_posts_link(__('&larr; Articoli precedenti', 'squirrel')); ?>
    </span> <span class="nav-next">
    <?php previous_posts_link(__('Nuovi articoli &rarr;', 'squirrel')); ?>
    </span> </nav>
    </div>
    </div>

    <div class="grid_8 omega">

    <!--Start Sidebar-->
     
  2. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Paste the code given below instead of above given code.

    Code:
    <?php
    /*
      Template Name: PRIME PAGE
     */
    ?>
    <?php get_header(); ?>
    <div class="clear"></div>
            <div class="page-content">
              <div class="grid_16 alpha">
                <div class="content-bar">
               <?php
                $limit = get_option('posts_per_page');
                $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
                query_posts('showposts=' . $limit . '&paged=' . $paged);
                $wp_query->is_archive = true;
                $wp_query->is_home = false;
                ?>
    <!-- Start the Loop. -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                  <div class="post">
                    <h1 class="post_title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
                    <ul class="post_meta">
                      <li class="posted_by"><span>Posted by</span>&nbsp;<?php the_author_posts_link(); ?></li>
                      <li class="post_date"><span>on</span>&nbsp;<?php echo get_the_time('M, d, Y') ?></li>
                      <li class="post_category"><span>in</span>&nbsp;<?php the_category(', '); ?></li>
                      <li class="postc_comment"><span> Blog</span>&nbsp;<?php comments_popup_link('No Comments.', '1 Comment.', '% Comments.'); ?></li>
                    </ul>
                    <div class="post_content"> <?php if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { ?>
                             <?php inkthemes_get_thumbnail(250, 170); ?>
                        <?php } else { ?>
                            <?php inkthemes_get_image(250, 170); ?> 
                            <?php
                        }
                        ?>
                      <?php the_content(); ?>
     <div class="clear"></div>
                        <?php if (has_tag()) { ?>
                            <div class="tag">
                                <?php the_tags('Post Tagged with ', ', ', ''); ?>
                            </div>
                        <?php } ?>
                      <a class="read_more" href="<?php the_permalink() ?>">Read More</a> </div>
                  </div>
                  <!--End post-->
     <?php endwhile;
    else: ?>
       <div class="post">
            <p>
                <?php _e('Sorry, no posts matched your criteria.', 'squirrel'); ?>
            </p>
        </div>
    <?php endif; ?>
    <!--End Loop-->
    <div class="clear"></div>
    <nav id="nav-single"> <span class="nav-previous">
                        <?php next_posts_link(__('&larr; Older posts', 'squirrel')); ?>
                    </span> <span class="nav-next">
                        <?php previous_posts_link(__('Newer posts &rarr;', 'squirrel')); ?>
                    </span> </nav>
              </div>
     </div>
              <div class="grid_8 omega">
     <!--Start Sidebar-->
            <?php get_sidebar(); ?>
            <!--End Sidebar-->
              </div>
            </div>
          </div>
     <?php get_footer(); ?> 
     
  3. marialberti

    marialberti New Member

    Joined:
    Jul 22, 2013
    Messages:
    8
    Likes Received:
    0
    Thank you.
    And to change the image size by side?
    height = 250px - width = 170px
     
  4. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Could you please specify us with the help of screenshot images that which image size you want to change
    and also share us your website link so that we can provide you exact solution.
     
  5. marialberti

    marialberti New Member

    Joined:
    Jul 22, 2013
    Messages:
    8
    Likes Received:
    0
  6. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Paste the code given below in Custom CSS section
    (Appearance -> Theme Options -> Styling Options -> Custom CSS) of your dashboard.

    Code:
    .page-content .content-bar .post .post_content img.postimg {
    background-size: 280px 325px;
    height: 280px;
    }
     
    You can adjust the value of "background-size" and "height" as per your requirement.
    This will solve your issue.
     
  7. marialberti

    marialberti New Member

    Joined:
    Jul 22, 2013
    Messages:
    8
    Likes Received:
    0
    I already have this code:

    #menu .ddsmoothmenu {​
    background:#c6c7c8;​
    }​
    #menu .ddsmoothmenu li > ul li > ul {​
    background-color:#2177a7;​
    }​
    #menu .ddsmoothmenu li li, #menu .ddsmoothmenu li li a:visited, {​
    background: #2177a7;​
    }​
    #menu .ddsmoothmenu li li a:link,{​
    color: #000;​
    background-color:#2177a7;​
    }​
    #menu .ddsmoothmenu li li a.selected, #menu .ddsmoothmenu li li a:hover, {​
    color: #fff;​
    background-color:#2177a7;​
    }​
    .footer {​
    background-color:#1c3372;​
    color:#fff;​

    }​
    .footer h1, .footer h2, .footer h3, .footer h4, .footer h5, .footer h6 {​
    color:#ffffff;​
    background:url(images/footer-sep-blue.png) bottom repeat-x;​
    }​
    .footer ul li a {​
    color:#fff;​
    }​
    .footer a:hover {​
    color:#fff;​
    }​
    .footer-strip {​
    background:url(images/footer-line-blue.png) repeat-x;​
    }​
    .bottom-footer {​
    background-color:#1c3372;​
    color:#fff;​
    }​
    .bottom-footer .footer_bottom_inner span.copyright a{​
    color:#fff;​
    }​
    .footer .searchform input[type="text"] {​
    background:url(images/search-bg-blue.png) no-repeat;​
    color:#b4d4e5;​
    }​
    .footer .searchform input[type="submit"] {​
    background:url(images/search-footer-glass.png) no-repeat;​
    }​
    .footer .searchform input[type="text"] {​
    background:url(images/search-bg-blue.png) no-repeat;​
    color:#c6c7c8;​
    }​
    .page-content .content-bar .post {​
    margin-right: 15px;​
    }​

    #nav-single {​
    margin-right: 15px;}​
    I tried to add the code that I've written, but it does not work.
     
  8. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Go to the Appearance -> Theme Options -> Styling Options -> Custom CSS section of your dashboard and follow the instruction shown in the image given below.

    [​IMG]

    After that try the instruction of above #6 post.
     

Share This Page