• Resolved David-T

    (@david-t-1)


    Hi, I don’t know what’s wrong, but I can’t make the blog page show more than the excerpt from one post.

    Obviously I want it to display as many as can fit on the content section

    https://www.surfsmart.dk/blog <– The website

    Anyone knows what I need to write to fix this? I’m 99% sure I need to add something in the index.php file, I just don’t know what..

    Here’s the important part of index.php

    <?php
    get_header();
    the_post();
    ?>
    
      <div id="content">
             <img class="tape" src="<?php echo get_template_directory_uri(); ?>/img/tape.png" alt="" />
            <div id="breadcrumb"><span xmlns:v="https://rdf.data-vocabulary.org/#"><span typeof="v:Breadcrumb"><span class="breadcrumb_last" property="v:title"><?php the_breadcrumb(); ?></span></span></span></div>
    
            <div class="topbillede"><?php echo rwmb_meta( 'surfsmart_topbillede' ); ?></div>
    
            <article style="margin-top:40px">
    
          <h1><?php the_title(); ?></h1>		
    
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?> - <?php the_author(); ?> - <?php the_date(); ?></a><br /><i>
    
    <?php the_excerpt( $more_link_text , $strip_teaser ); ?>

    What do I need to add to get more excerpts to fit on the page?

    Much appreciated ??

    Dave

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter David-T

    (@david-t-1)

    Btw, of course I already set Settings / Reading to show 5 posts, but my blog completely ignores it..

    Michael

    (@alchymyth)

    a loop has the general structure:

    <?php if( have_posts() ) :
    while( have_posts() ) :
    the_post();
    
    //output section
    
    endwhile;
    else : echo 'no posts';
    endif; ?>
    Thread Starter David-T

    (@david-t-1)

    Hi, I already tried adding that, just before the end of </article as I’ve seen adviced by many here, no luck.

    Don’t know if anyone wants to look at it, but here’s the code for index.php

    <?php
    get_header();
    the_post();
    ?>
    
      <div id="content">
    
             <img class="tape" src="<?php echo get_template_directory_uri(); ?>/img/tape.png" alt="" />
            <div id="breadcrumb"><span xmlns:v="https://rdf.data-vocabulary.org/#"><span typeof="v:Breadcrumb"><span class="breadcrumb_last" property="v:title"><?php the_breadcrumb(); ?></span></span></span></div>
    
            <div class="topbillede"><?php echo rwmb_meta( 'surfsmart_topbillede' ); ?></div>
    
            <article style="margin-top:40px">
    		<h1><?php the_title(); ?></h1> 
    
                <?php the_content(); ?>
    <br>
    <?php the_author(); ?> - <?php the_date(); ?> 
    
    <?php if( have_posts() ) :
    while( have_posts() ) :
    the_post();
    
    //output section
    
    endwhile;
    else : echo 'no posts';
    endif; ?>
    
            </article>
    
            <div class="bundbillede"><?php echo rwmb_meta( 'surfsmart_bundbillede' ); ?></div>
            <p class="deldette">Del siden</p>
    	<div style='margin-top:20px;'><?php the_ratings(); ?></div>
            <div class="sharethis">
                <div class="addthis_toolbox addthis_default_style" style="float:left">
                    <a id="facebookLike" class="addthis_button_facebook"></a>
                    <a class="addthis_button_linkedin"></a>
                    <a class="addthis_button_tweet"></a>
                    <a id="plusone" class="addthis_button_google_plusone"></a>
                </div>
            </div>
            <script type="text/javascript">
                var facebookLike = document.getElementById("facebookLike");facebookLike.setAttribute("fb:like:layout", "button_count");facebookLike.setAttribute("fb:like:show_faces", "false");facebookLike.setAttribute("fb:like:width", "100");facebookLike.setAttribute("fb:like:action", "share");facebookLike.setAttribute("fb:like:font", "tahoma");facebookLike.setAttribute("fb:like:colorscheme", "light");var plusone = document.getElementById("plusone");plusone.setAttribute("g:plusone:size", "medium");plusone.setAttribute("g:plusone:lang", "it-IT");plusone.setAttribute("g:plusone:width", "100");
            </script>
    
            <div class="priserne"><?php echo rwmb_meta( 'surfsmart_price' ); ?></div>
    
    <div style='margin-left:400px;'><?php posts_nav_link( $sep, $prelabel, $nextlabel ); ?></div>    
    
    </div>
    </div> <!-- end pagebox -->
    <?php get_sidebar(); ?>
    <div style="clear:both"></div>
    <?php get_footer(); ?>

    Is there anything obvious that I need to add to index.php to make WP show more than one post? Right now I don’t even care about excerpts, I just want it to show more than one post :S

    Thread Starter David-T

    (@david-t-1)

    I found a solution, however it’s a pretty ‘dirty’ solution and not the one I wanted to use to solve this problem.

    I basically created a new template and hardcoded it, now at least it does what it’s supposed to.

    Closing.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to show more than one post excerpt on my blog page?’ is closed to new replies.