Forums

[resolved] the_excerpt function (16 posts)

  1. alvanweb
    Member
    Posted 6 years ago #

    I want create a public linkdump with wordpress Than users can register and enter
    Links. I usage this method:

    Title fild: for link title
    Excerpt box: for link Url
    And Post box for link description.
    but the_excerpt function return a <P> tag in link url address.

    This is true about the_excerpt function because its relates excerpt text.
    at present how I remove <P> tag in output the_excerpt function?

  2. Kafkaesqui
    Moderator
    Posted 6 years ago #

    Try:

    <?php the_excerpt_rss(); ?>

    This will not *impose* any HTML on the excerpt. If that doesn't work for you, you could display the excerpt raw:

    <?php echo $post->post_excerpt; ?>

  3. moshu
    Member
    Posted 6 years ago #

    Oh! So, is this true, that the excerpt puts a p-tag into the links? There is nothing about in the Codex :(
    There was a discussion yesterday ( http://wordpress.org/support/topic/39098 ) and couldn't find any explanation for the in the links... Maybe that photoblog theme uses the excerpt???

  4. Kafkaesqui
    Moderator
    Posted 6 years ago #

    "Oh! So, is this true, that the excerpt puts a p-tag into the links"

    Not quite. the_excerpt() places the excerpt text in paragraph elements, for purposes of making it valid XHTML (text out on it's own is not).

  5. moshu
    Member
    Posted 6 years ago #

    OK, maybe my wording is not perfect (it never is ;) but, please, be patient with me: would that mean that having in the excerpt something like
    <a href="http://example.com/?p=2"><img src='/images/pic.jpg' alt='pic' width="800" height="600"/></a>
    would end up in the displayed code as:
    <a href="http://example.com/
    ?p=2"><p><img src='/images/pic.jpg' alt='pic' width="800" height="600"/></p>
    </a>

  6. Kafkaesqui
    Moderator
    Posted 6 years ago #

    On wording: I just wanted to be clear. ;)

    As for the issue, it's:

    <a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a>

    that leads to:

    <a href="http://example.com/?p=2"><p><img src='/images/pic.jpg' alt='pic' width="800" height="600"/></p></a>

  7. moshu
    Member
    Posted 6 years ago #

    Actually, I am not 100% sure. See the topic I linked above, where the issue came up, and we couldn't figure out where those <p> tags were coming from. I had to give up finding a solution, but now reading this thread suddenly I had this "genial" idea that the p-things might be related :)

  8. Kafkaesqui
    Moderator
    Posted 6 years ago #

    On this I am 99.99996% certain the theme is using the example above to display the image as a link.

  9. Beel
    Member
    Posted 6 years ago #

    Of or relating to the chin, moshu? As in taking it on the chin? ;-)

  10. kusman
    Member
    Posted 5 years ago #

    But it come to block all the excerpt text. I am only want the link only at the "[...]"

    I use "<?php the_excerpt(); ?>">more..."

    Any idea..?

    Thanks
    http://www.budidayalobsterairtawar.com

  11. moshu
    Member
    Posted 5 years ago #

    No ideas...
    The "[...]" is NOT a link. Doesn't work like that. Sorry.

    With the expert the permalink is the title. Nothing else.

    And the "more" does NOT work with the_excerpt. Only with the_content. But in that case you have to insert the "more" tag manually into the text where you want to break it.

  12. kusman
    Member
    Posted 5 years ago #

    Oh.. I am tried to find like this.. Finaly my trick is correct.

    How to use the "more" tage.

  13. moshu
    Member
    Posted 5 years ago #

    When you write a post you have to insert the tag in the text.
    If you use the WYSIWYG editor there is a button for it: between the Image and Undo buttons.

    If you use the normal html editor - there is a "Quicktag" for it above the Write textarea.

    The code is <!--more-->

  14. kusman
    Member
    Posted 5 years ago #

    Your mean that the <!--more--> should be put in the post not in the .php ?

  15. joshziman
    Member
    Posted 5 years ago #

    Just briefly read the title and first post cause I gotta go soon, but I came across this plugin today, works good, requires some but minimal promgramming skills.

    The Excerpt Reloaded

  16. kusman
    Member
    Posted 5 years ago #

    Thanks joshziman

    I work great as what I want.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.