Viewing 15 replies - 1 through 15 (of 15 total)
  • Put <!--more--> where you want that break.

    Thread Starter perykm

    (@perykm)

    How do I do this if I want this to occur on every post on the main page? Where do I insert the code?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    You insert that code into every post, where you want the break to be.

    you want to use the template tag the_excerpt rather than the_content on your index.php file, assuming you aren’t using a home.php file.

    Also, there’s a plugin Excerpt reloaded, that lets you define the number of characters that are shown.

    Template_Tags/the_excerpt

    Thread Starter perykm

    (@perykm)

    Sweet! Thanks. So now that I have the <?php the_excerpt(); ?> in place, how can I make a link like “Read More..” Instead of […]?

    Thread Starter perykm

    (@perykm)

    <?php get_header(); ?>

    <div id=”primary” class=”twocol-stories”>
    <div class=”inside”>
    <?php
    // Here is the call to only make two posts show up on the homepage REGARDLESS of your options in the control panel
    query_posts(‘showposts=2’);
    ?>
    <?php if (have_posts()) : ?>
    <?php $first = true; ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class=”story<?php if($first == true) echo ” first” ?>”>
    <h3>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h3>
    <?php the_excerpt(); ?>
    <div class=”details”>
    <?= _(‘Posted at’) ?> <?php the_time(‘ga \o\n ‘ . $hemingway->date_format(true) . ‘/y’) ?> | <?php comments_popup_link(‘no comments’, ‘1 comment’, ‘% comments’); ?> | Filed Under: <?php the_category(‘, ‘) ?>
    </div>
    </div>
    <?php $first = false; ?>
    <?php endwhile; ?>
    </div>

    <?php else : ?>

    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>

    <?php endif; ?>

    <div class=”clear”></div>
    </div>
    <!– [END] #primary –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    The tag referred to as the_excerpt doesn’t let you have “more” tag. Obviously, you didn’t read the references miklb provided above. Go and read them.
    You’ll also find out that the plugin linked above will let you have both: the_excerpt and more tag.

    Thread Starter perykm

    (@perykm)

    I’m still new to this, so its kinda confusing.

    Thread Starter perykm

    (@perykm)

    Ok so things are working great now….but when I added the plugin, the line height changed on the main page. Where would I edit the css to change this?

    Thread Starter perykm

    (@perykm)

    NM…I figured it out. Thanks.

    I downloaded and installed this plugin (excerpt reloaded) and cannot get it to work correctly. I installed it thru the control panel, but what code do I need to put in the loop of my index file to make it work? is this my template index file or the overall wordpress index in the root folder?

    In the index file in your active theme folder. Always. Never touch that “short and sweet” index in the root ??

    As for the code you need – see the plugin’s page for examples and for the parameters you can use.

    The plugin’s website has the following:

    Usage:

    <?php the_excerpt_reloaded(excerpt_length, ‘allowedtags’, ‘filter_type’, use_more_link, ‘more_link_text’, force_more_link, fakeit, fix_tags); ?>

    so this is the function, where does this code go?

    <?php the_excerpt_reloaded(); ?>

    this calls the function and should be in the Loop correct?

    Do they both go in the Loop or does the function go elsewhere?

    The function
    <?php the_excerpt_reloaded(); ?>
    should replace your existing
    <?php the_content(); ?> or the_excerpt (whichever is there) – in the “middle” of the Loop.
    That’s all.

    And from the plugin’s website you can get real working examples, too (just scroll down and READ before you post!…) – what you quoted is the “general instructions” only for the order of the parameters;
    e.g. – excerpt_length – you should use a number, 70 (=70 words)
    ‘allowed tags’ > '<a><img><em>' and so on…

    I cannot get it to work. I uninstalled the plugin, re-installed it and changed that one line, and it doesn’t change anything. My one post is well over the default 120 words so it should affect it, and I do not have an extra excerpt set in the ‘manage post’ area, no other special settings. What could I be doing wrong?

    My page: https://www.crawlmag.com/wordpress/

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How To Add […] After A Certain Number of Words?’ is closed to new replies.