WordPress.org

Ready to get started?Download WordPress

Forums

how do I change the "[...]" after the excerpt? (12 posts)

  1. semidivine
    Member
    Posted 6 years ago #

    Simple question, I hope... I really can't stand the way the "[...]" looks after the excerpt, it doesn't make sense to me, and I really would love to just have "..." show up. I did a WordPress-wide search for it in the code to see where it is, and I found something in wp-includes/formatting.php and changed the occurrence of "[...]" on line 804 (it's in function wp_trim_excerpt.) I also changed $excerpt_length to 45. I then uploaded the file and nothing on the site has changed. What am I doing wrong? I can't find it anywhere else.

  2. moshu
    Member
    Posted 6 years ago #

    Since I don't like editing core files... I always use a plugin for handling the excerpt.
    This is my favourite:
    http://guff.szub.net/2005/02/26/the_excerpt-reloaded/
    although there are others, too.

  3. semidivine
    Member
    Posted 6 years ago #

    Thanks! I just tried it and it doesn't work with my jLanguage plug in, so I need to try something else. If I ever mess with core files it's always to change silly details like this, I never mess with any functionality.

    So I guess I'll go back to my original question... do you know where that "[...]" resides in the code? I'll proceed at my own risk.

  4. mdi
    Member
    Posted 6 years ago #

    you don't have to edit any core files, you can instead add arguments to the template tag. for example any text, dots, etc:

    <?php the_content('...'); ?>

    or any html-code (<p>...</p> doesn't validate):

    <?php the_content('<span class="my-excerpt">read more</span>'); ?>

    i don't like my short answers, but my english isn't good enough... ;-)

    edit: you have to add the "more-tag" manually in your posts to make this work, because now in your template you don't use "the_excerpt".

  5. semidivine
    Member
    Posted 6 years ago #

    The more tag is not going to work... the client is going to be updating this site and is not going to know to put a more tag in. I just need the excerpting process to be automatic. So... I need to use the the_excerpt function, using a plugin to create a different ellipses style doesn't work because I haven't found one that works with jLanguage (the plugin I use to have two languages on the site) so can someone pleeeeeeease tell me where to change the "[...]" in the code? I would so appreciate it.

  6. moshu
    Member
    Posted 6 years ago #

    Well, if you have clients that pay you... you should have the necessary tools to find a string in the files.

  7. semidivine
    Member
    Posted 6 years ago #

    that was rude.

    I told you I did a search of the whole of wp (using BBEdit) and couldn't find the string. it is possible that it's in the code using html entities, although I searched for that as well and still couldn't find it. do you actually think I didn't exhaust all possibilities before calling upon this resource?

    if you know where it is could you please tell me? why on earth do i have to ask three times?

  8. semidivine
    Member
    Posted 6 years ago #

    found it! I am using the plugin EventCalendar3 and there is a function there that hijacks the wp excerpt function. That's why when I changed the function in formatting.php, nothing happened.

    For anyone who cares, the function is in eventcalendar3.php in the Eventcalendar3 plugin folder, line 535.

    Thanks god that's over.

  9. kjlietz
    Member
    Posted 6 years ago #

    Hi semidivine,

    i have a problem with get_excerpt too. I also use eventcalendar3. What exactly did you change?

    I am not getting the excerpt, that I put into the database. The system is making its own excerpt with the result, the it is not good formatted and longer than intended. :-(

    This is my code:

    <?php
    $postlist_1 = get_posts('numberposts=36&category=6');
    $postlist = array_reverse($postlist_1);
        if ($postlist) {
    	foreach ($postlist as $post) {
    		setup_postdata($post);
    				echo '<h2 id="post-', the_ID(), '"><a href="', the_permalink(), '" rel="bookmark" title="Permanent Link to ', the_title(), '">', the_title(), '</a></h2>';
    		echo('<div class="entry">');
    		the_excerpt();
    		echo "</div>";
    		echo('</div>');
    	}
    }
    ?>

    Thanks in advance!

  10. semidivine
    Member
    Posted 6 years ago #

    I'm not sure what you want to change about it, but EventCalendar3 definitely has the final say in how the excerpt shows up.

    Go to eventcalendar3.php in the Eventcalendar3 plugin folder, line 535. That's where you can put your own excerpt styling.

    Good luck!

  11. sallymcdonald
    Member
    Posted 5 years ago #

    I changed the [...] via wp-includes/formatting.php myself! It worked just fine, I wonder why it didn't work for you? :( What a shame! It's so much easier to just edit a line of code than to install an entire plugin, at least in my opinion.

    Oh, and don't mind moshu --- He's quite rude in all of his 'support' posts, and he seems to believe that no one knows more about WordPress than him. Not sure how he became a moderator with that sort of attitude!

  12. Chris_K
    Member
    Posted 5 years ago #

    It's so much easier to just edit a line of code than to install an entire plugin, at least in my opinion.

    ... just remember you'll have to do it after every upgrade ...

    (and frankly, the personal attack you slipped in there didn't really help anything.)

Topic Closed

This topic has been closed to new replies.

About this Topic