• Resolved aemars

    (@aemars)


    Hello,

    On the main page of my site, at the bottom, there is a place for “Recent Posts.” The images are currently lining up directly underneath each other and touching with a gap between the last two images. I would like for the images to be on the left and the wording: date, title, and excerpt to be on the right.

    I’m not sure how to fixing this issue and am very new to coding. My site is: https://www.aimeemars.com

    I would greatly appreciate any help. I’ve been searching the forum and trying to implement different codes but can’t find anything that works.

    Thanks!

    Here is my code:

    <div class=”container”>

    <div class=”bottom-left”>
    <div class=”recent-posts2″>

    <h1 class=”seamist”>Recent Posts</h1>

    <?php
    $postslist = get_posts(‘showposts=4&cat=$category&offset=1’);
    foreach ($postslist as $post) :
    setup_postdata($post);
    ?>
    <div class=”entry”>
    <div class=”thumbnail”>
    <?php
    if(has_post_thumbnail()) {
    the_post_thumbnail();
    } else {
    // show a default image if no featured image is specified
    echo ‘‘;
    }
    ?>
    </div>

    <div class=”date2″>
    <?php the_date(); ?>
    </div>

    <h3>“><?php the_title(); ?></h3>

    <?php the_excerpt(); ?>

    </div>
    <?php endforeach; ?>

    <div class=”recent-posts-button”>
    Read More Recent Posts Button
    </div>

    </div>
    </div>

    </section>

    </div>

    <div class=”bottom-right”>
    <div class=”sidebar-bottom”>
    <?php get_template_part(‘sidebar’); ?>
    </div>
    </div>

    and here is the CSS:

    .container {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-top: 75px;
    width: 1050px;
    max-width: 85%;
    border-top: 1px solid #6D6E70;
    }

    .bottom-left {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
    }

    .bottom-right {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
    }

    .recent-posts2 {
    width: 575px;
    padding-right: 50px;
    float: left;
    display: inline;
    }

    .recent-posts2 h1 {
    font-family: ‘Lato’, sans-serif;
    text-transform: uppercase;
    font-size: 16pt;
    letter-spacing: 17px;
    font-weight: 400;
    color: #B9CBB7;
    padding-top: 5px;
    padding-bottom: 5px;
    text-align: left;
    margin-bottom: 50px;
    }

    .date2 {
    font-family: ‘Lato’, sans-serif;
    text-transform: uppercase;
    text-align: left;
    font-size: 8pt;
    letter-spacing: 4px;
    font-weight: 300;
    color: #B9CBB7;
    }

    .recent-posts2 h3 {
    font-family: ‘Lato’, sans-serif;
    text-transform: uppercase;
    text-align: left;
    font-size: 12pt;
    letter-spacing: 5px;
    font-weight: 300;
    color: #B9CBB7;
    }

    .recent-posts2 p {
    margin-bottom: 75px;
    font-family: ‘Amiri’, serif;
    font-size: 16px;
    font-weight: 400;
    font-style: italic;
    text-align: justify;
    text-align-last: start !important;
    color: #989898;
    }

    .recent-posts2 .thumbnail {
    float: left;
    display: inline;
    width: 300px;
    height: 300px;
    margin-right: 25px;
    }

    .recent-posts2 .recent-posts-button {
    float: left;
    display: inline;
    margin-bottom: 55px;
    }

Viewing 9 replies - 1 through 9 (of 9 total)
  • .recent-posts2 .entry::after {
    display: block;
    clear: both;
    content: ” “;
    margin: 0 0 25px;
    }

    and find your css

    .recent-posts2 p {
    /* margin-bottom: 75px; remove this line*/
    font-family: ‘Amiri’, serif;
    font-size: 16px;
    font-weight: 400;
    font-style: italic;
    text-align: justify;
    text-align-last: start !important;
    color: #989898;
    }

    Thread Starter aemars

    (@aemars)

    I was able to fix the alignment, sort of, but the spacing is different between the posts. Now the images and excerpts are not spaced equally with the first and last posts being further away from the two middles posts.

    Any help with fixing this alignment would be greatly appreciated.

    Thanks,

    Aimee

    hi aemars if you use this to align your images you should remove the margin bottom of your .recent-post2 p

    .recent-posts2 .entry::after {
    display: block;
    clear: both;
    content: ” “;
    }
    .recent-posts2 .entry {
    margin: 0 0 25px;
    }
    ———————–

    this is to make the spaces of the entry to be even. find your css and remove the commented line

    .recent-posts2 p {
    /* margin-bottom: 75px; remove this line*/
    font-family: ‘Amiri’, serif;
    font-size: 16px;
    font-weight: 400;
    font-style: italic;
    text-align: justify;
    text-align-last: start !important;
    color: #989898;
    }

    • This reply was modified 8 years, 1 month ago by darick0029.
    • This reply was modified 8 years, 1 month ago by darick0029.
    Thread Starter aemars

    (@aemars)

    Hey darick0029!

    Thank you for your help! I did exactly what you said and it did move the information, however now the two middle images are touching and there should be a space between them. Did I do something wrong?

    Thanks again for your help and quick reply! I’m trying not to go nuts here!

    Aimee

    hi Aimee,

    upon checking your site i didnt see that you add the css that i mentioned on my reply. not sure whats the reason why the css is not appearing on your site.

    okay please be sure that you put this on your css. then purge cache if you have some wp caching.

    .recent-posts2 .entry::after {
    display: block;
    clear: both;
    content: “”;
    }
    .recent-posts2 .entry {
    margin: 0 0 25px;
    }

    please make sure that you put it on your css.

    oh now i see why its not working. you already put the css but because the quotes are automatically change by post reply here on the forum thats why its not working. check this image so you can understand what i mean. https://www.screencast.com/t/p7zKUFfwiQW

    you should replace it with this ” “

    • This reply was modified 8 years, 1 month ago by darick0029.
    Thread Starter aemars

    (@aemars)

    Got it!! Okay, I missed a small part of the code you added and the “” marks showed up as a different symbol. As soon as I fixed that it was set up properly. Thanks for your help. This has been bothering me for a while now.

    Now I just have to figure out how to make my site more responsive…ha!

    Thanks again.

    Moderator bcworkz

    (@bcworkz)

    For everyone’s information, it is essential when pasting code into these forums that you use the code button or bracket your code with `backticks`. Otherwise the forum’s text parser will corrupt you code. The straight quotes converted to “curly quotes” is only one characteristic, there are many other ways for code to be corrupted.

    For pasted/copied code in these forums to be usable within WordPress, it must be placed within `backticks` or you must use the code button.

    Thread Starter aemars

    (@aemars)

    Ah, okay! Thanks. Didn’t know that would happen.

    Thanks for your help all.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Recent Posts image position not lining up properly’ is closed to new replies.