• Resolved BIGI

    (@bgeo77)


    Hello,

    I’m having problems setting the first 2 (instead of 1) posts as static images (instead of slider).

    I’ve manage to set 2 featured posts at the same size (width: 100%) but I can’t find/I don’t know how to add a space between the second featured posts and the post list.

    What I’ve done for now is editing the featured.php lines:
    <?php if ( is_home() && !is_paged() && ( hu_get_option('featured-posts-count') =='2') && $featured->have_posts() ): // No slider if 2 or 1 or 0 post is featured ?>

    and <?php elseif ( is_home() && !is_paged() && ( '0' != hu_get_option('featured-posts-count') ) && $featured->have_posts() ): // Show slider if posts are not 2 or 1 or 0?>

    What I’ve also tried is something old:
    <?php $i = 1; echo '<div class="post-row first-row">'; while ( have_posts() ): the_post(); ?>
    adding this to the index-tmpl.php
    and adding

    .post-row.first-row .post {
      width: 100%;
    }

    to the style.css (child/parent) , assets/front/css/main.css

    Another thing that I don’t really get is:
    My new “Lorem Ipsum” post show x words (followed by …). The other demo posts show another words from the post (not the first x)

    (I also tried to search for the entire sentence, but couldn’t find the full sentence)

    Thanks, and I said before great theme.
    Keep up the good work!

    http://wp.iambigi.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter BIGI

    (@bgeo77)

    So, I’m back.

    In the end I did:

    <?php  $i = 1; echo '<div class="post-row first-row">'
         		if ( have_posts() ) {
    			hu_get_template_part( 'parts/post-list-articles' );
         	 }
       	 ?>

    The problem is that, all post are not transformed to “featured post” (100% width) instead only the first one, $i having no importance there.

    Thread Starter BIGI

    (@bgeo77)

    So… I managed to do the opposite of what I want (I’m having first 2 posts as 50% width and the rest of them as full width), by replacing this:

    <?php else: ?>
      <div id="grid-wrapper" class="post-list group">
        <?php global $wp_query; while ( have_posts() ): the_post(); ?>
          <?php get_template_part('content'); ?>
        <?php if( ( $wp_query->current_post + 1 ) % 2 == 0 ) { echo '<div class="post-row">'; }; endwhile; echo '</div>';?>
    
    with this:
    
    <?php else: ?>
    <div id=”grid-wrapper” class=”post-list group”>
    <?php global $wp_query; echo ‘<div class=”post-row”>’; while ( have_posts() ): the_post(); ?>
    <?php get_template_part(‘content’); ?>
    <?php if( ( $wp_query->current_post + 1 ) % 2 == 0 ) { echo ‘<div class=”post-row”>’; }; endwhile; echo ‘</div>’; ?>
    

    in the post-list-articles.php

    The problem is, I can’t get what I really want (first 2 post being full width, and the others to be 50% width). Not using featured images right now.

    • This reply was modified 7 years ago by BIGI.
    • This reply was modified 7 years ago by BIGI.
    Thread Starter BIGI

    (@bgeo77)

    Problem solved with the featured posts.

    Changed this in featured.php
    <?php if ( is_home() && !is_paged() && ( hu_get_option('featured-posts-count') =='2') && $featured->have_posts() ): // No slider if 2 or 1 or 0 post is featured ?>

    Added this to the CUSTOMIZER – Additional CSS (I forgot about this function first time and edited the main.css file..and it didn’t work)
    .featured .post { padding-bottom: 30px;}

    • This reply was modified 7 years ago by BIGI. Reason: featured.php instead of functions.php
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘More than 1 static featured posts (no slider)’ is closed to new replies.