Support » Fixing WordPress » excerpt stuff?

  • Is there a way I can make a post on the front page display an excerpt if I enter one but not if I don’t and not limit the post to 55 characters. also I’d like a read more image to show on a post with an excerpt. I know about the <!–more–> tag and it doesn’t do exactly what I want.

    Edit: and yes I have looked at codex 🙂

Viewing 15 replies - 1 through 15 (of 18 total)
  • Maybe you need some excerpt related plugin(s). Take a look and search the Extend > Plugins section.

    looked already I don’t see any that will do what I want

    nope I don’t even get what its suppose to do all I want is for a summary to be on the front page for long posts and a read on link. I don’t want to use the “more” tag because it shows your teaser / summary in the actual post but the excerpt doesn’t

    in fact it just broke my blog and made me have to remove it nice plugin >:(

    the excerpt question i can’t answer. but the read more image:
    <a href="<php the_permalink()?>" ><img src="path of your read more image file"/></a>

    I know how to do that, sigh I created this
    <?php if (!empty($post->post_excerpt)) {the_excerpt(); } else { the_content(); } ?> 
    statement but it doesn’t work it gives me this error
    Parse error: syntax error, unexpected T_STRING in domains/alexrogahn.com/html/wp-content/themes/AlexRogahnTheme/index.php on line 25

    managed to make it work

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt();
     } else {
         the_content();
     } ?>

    but I only want the read on link when it displays the excerpt once I have that I’m all finished ^.^

    Then use the code given to you by mks6804 after the_excerpt

    nope it doesn’t show up, hmmm this is what I’ve got

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt('<a href="<?php get_permalink() ?>">TEST</a>');
     } else {
         the_content();
     } ?>

    It won’t work am I doing something wrong?

    Yes. It is not a parameter of the_excerpt. It should be AFTER the template tag.

    I tried it like this first:

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt(); <a href="<?php get_permalink() ?>">TEST</a>
     } else {
         the_content();
     } ?>

    it gave me this error

    Parse error: syntax error, unexpected '<' in /domains/alexrogahn.com/html/wp-content/themes/AlexRogahnTheme/index.php on line 26

    then I tried it like this

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt()<a href="<?php get_permalink() ?>">TEST</a>;
     } else {
         the_content();
     } ?>

    and It gave me this:

    Parse error: syntax error, unexpected T_STRING in /domains/alexrogahn.com/html/wp-content/themes/AlexRogahnTheme/index.php on line 26

    a little help plz?

    Because you need to close the PHP before starting HTML code or need to echo.
    I am not a coder, so never trust the code I write:

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt();
    echo "<a href="<?php get_permalink() ?>">TEST</a>";
     } else {
         the_content();
     } ?>

    (or something like this)

    On the other hand, with a little bit of search you could have find this, too:

    Customizing the WordPress Loop for Excerpt Queries

    Fixed:

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt(); ?>
    <a href="<?php get_permalink() ?>">TEST</a>
    <?php
     } else {
         the_content();
     } ?>

    lol thanks, but this is the code that did what I wanted without any errors or loss of function

    <?php if(!empty($post->post_excerpt)) {
         the_excerpt();
    echo '<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>Read the rest of this article &raquo;</a>';
     } else {
         the_content();
    echo '<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>Goto Post Page &raquo;</a>';
     } ?>

    hope this helps anyone wanting the same as me to 🙂

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘excerpt stuff?’ is closed to new replies.