• Resolved verdipro

    (@verdipro)


    Does anyone have a solution to the below? I have tried a bunch of different tags, but nothing seems to work.

    Site is: https://key2sportstraining.com/

    1) Below articles there are 7 blog posts. What is the best way to show more than just those paragraphs on the homepage?

    2) One of the posts has a video. Video shows up great on the posts page, but not on the homepage. How can I get it to appear on the homepage?

    I have posted the code I am currently using below. I have tested the limit words being higher than 500 & it does not show anymore. In fact the posts are not even showing 500 currently.

    <h1 class=”title”>Articles</h1>
    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query(‘showposts=7′.’&paged=’.$paged);
    ?>
    <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <header>
    <h2 class=”title”>” title=”<?php the_title(); ?>” rel=”bookmark”><?php the_title(); ?></h2>
    <div class=”post-meta”>
    <div class=”fleft”>Posted in: <?php the_category(‘, ‘) ?> | <time datetime=”<?php the_time(‘Y-m-d\TH:i’); ?>”><?php the_time(‘F j, Y’); ?> at <?php the_time() ?></time> , by <?php the_author_posts_link() ?></div>
    <div class=”fright”><?php comments_popup_link(‘No comments’, ‘One comment’, ‘% comments’, ‘comments-link’, ‘Comments are closed’); ?></div>
    </div><!–.post-meta–>
    </header>
    <?php echo ‘<div class=”featured-thumbnail”>’; the_post_thumbnail(); echo ‘</div>’; ?>
    <div class=”post-content”>
    <div class=”excerpt”><?php $excerpt = get_the_excerpt(); echo my_string_limit_words($excerpt,500);?></div>
    ” class=”link”>Read more
    </div>
    <footer>
    <?php the_tags(‘Tags: ‘, ‘, ‘, ”); ?>
    </footer>
    </article>

Viewing 5 replies - 1 through 5 (of 5 total)
  • You may be better off using the_content() (or get_the_content()). Tags and graphics are stripped from excerpts, assuming that get_the_excerpt() behaves like the_excerpt(), which I think it does.

    You can change the default excerpt length, if you want. The Codex article has all the details.

    HTH

    PAE

    Thread Starter verdipro

    (@verdipro)

    thank you very much for the reply. I will take a look at the code & test an update.

    Thread Starter verdipro

    (@verdipro)

    The get_the_content worked great. Shows the video and everything. Only bad thing it did was for some reason pushed the sidebar below the content, only in IE8, but I will figure that out. I did try to make the width of the content smaller & that didnt fix it, so must be another issue somewhere. Thanks!

    Yeah. IE can have some strange ideas about what constitutes a width. You also sometimes have to be careful of widths expressed in ems unless you’ve specified a base font size. IE often renders fonts larger than other browsers, I’ve found.

    I’d put your IE specific stuff in an IE specific style sheet, which you can access in your header.php using bloginfo('stylesheet_directory)/ie8.css (or whatever you want to call your IE style sheet.

    Cheers

    PAE

    Thread Starter verdipro

    (@verdipro)

    excellent, thanks again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Blog posts issues on wordpress site homepage’ is closed to new replies.