• Resolved tgberk

    (@tgberk)


    Hello,

    First of all, thanks for this great theme. I want to know if i can show 3 or 4 thumbnails on pages with 2 sidebar layout?

    Thank you.

Viewing 12 replies - 1 through 12 (of 12 total)
  • bdbrown

    (@bdbrown)

    Hi tgberk. Welcome to the Hueman forum. Show 3 or 4 thumbnails on which page?

    Thread Starter tgberk

    (@tgberk)

    Hello, I want to show 3 thumbnails with left side bar on home page where recent post published. Thank you.

    bdbrown

    (@bdbrown)

    You can set the number of posts to display in the AlxTabs widget options.

    Thread Starter tgberk

    (@tgberk)

    No, i am asking for show 3 posts per row on home page. Theme only let me show 1 or 2.

    bdbrown

    (@bdbrown)

    1. Copy index.php to your child theme. If you’re not using a child theme you can download a preconfigured child theme from the theme web site.

    2. In index.php change the 2 in this line:

    <?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>

    to a 3:

    <?php if($i % 3 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>

    3. Add this to your child theme style.css file:

    .home .post-list .post {
        width: 33%;
    }
    Thread Starter tgberk

    (@tgberk)

    It worked, thank you very much!

    bdbrown

    (@bdbrown)

    You’re welcome. If you don’t need any further assistance with this topic please mark it as Resolved. Thanks.

    Thread Starter tgberk

    (@tgberk)

    Hello,

    I noticed that these codes shows 3 thumbnails on smartphones too. How can i change to default style for phones? because it makes difficult to read.

    You could replace the css in step 3 above with a media query so the post width is only reset above the tablet view width:

    @media only screen and (min-width: 960px) {
        .home .post-list .post {
            width: 33%;
        }
    }

    For the tablet view and narrower it would default to 50% width. The problem with this is, in the tablet view the php change you made in step 2 above is still sending 3 posts per row, but now the post size is 50%, so you end up with:

    post  post
    post
    post  post
    post

    You could try using a plugin like this to determine the browser:
    https://www.ads-software.com/plugins/php-browser-detection/
    (Don’t know anything about that plugin so not sure how reliable or effective it is.)

    Then, in index.php, you would change this:

    <?php if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?>

    to this:

    <?php if(is_desktop()) {
      if($i % 3 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>';
    } else {
      if($i % 2 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>';
    } ?>
    Thread Starter tgberk

    (@tgberk)

    Thank you. For the last step, should I use the plugin or can I just change index.php?

    should I use the plugin or can I just change index.php?

    You would need to do both. The plugin contains the functions to determine the view, and you need to edit index.php to call the desired function.

    Thread Starter tgberk

    (@tgberk)

    Okey I understand, thank you very much. I am going to do these steps

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Can i get 3 or 4 thumbnails?’ is closed to new replies.