Forums

[resolved] Comment Teaser? (13 posts)

  1. keydin
    Member
    Posted 3 years ago #

    I was wondering if anyone knew of a plugin that will allow me to insert a comment teaser within a post.

    For example if I want to add "what do you think?" at the end of a post to encourage someone to leave a comment that would link to the comment for the post.

    I can't hyperlink the text "#respond" because that would only work if I was looking at the single page view of the post.

    Any ideas?

  2. vachi
    Member
    Posted 3 years ago #

    you can use this :)

    <a href="<?php the_permalink() ?>#respond"></a>
  3. keydin
    Member
    Posted 3 years ago #

    Oh duh. Thanks.

    You know what would be cool would be a plugin that put a form field that you could post the tease automatically in the post.

  4. vachi
    Member
    Posted 3 years ago #

    maybe i should write one hehe, it would be my first plugin if i do :) make the post resolved please

  5. keydin
    Member
    Posted 3 years ago #

    oops. that doesn't work. won't pickup the wordpress permalink reference. See the end of my first post here steveeller.com

    Yes I have runPHP enabled for this post.

  6. vachi
    Member
    Posted 3 years ago #

    how about instead of putting this teaser in the post, put it in the post loop, so it comes up for all the posts automatically
    so like put
    <div class="teaser"><a href="<?php the_permalink() ?>#respond"></a></div>
    and put this like after the
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    try that

  7. keydin
    Member
    Posted 3 years ago #

    The only problem is that text being used with the link will change from post to post.

    for example:

    <div class="teaser">#respond">Text that will change every post

  8. keydin
    Member
    Posted 3 years ago #

    oops forgot to use the code tag:

    <a href="<?php the_permalink() ?>#respond">Text that will change every post</a>

  9. vachi
    Member
    Posted 3 years ago #

    when you are posting code put it in the it between backticks
    "Put code in between backticks."

  10. keydin
    Member
    Posted 3 years ago #

    Yeah I know

  11. keydin
    Member
    Posted 3 years ago #

    Well I guess I will just have to manually past in the link to the comment. Oh well.

  12. vachi
    Member
    Posted 3 years ago #

    ohh i see your idea, well than we can do that actually
    with custom fields

    <a href="<?php the_permalink() ?>#respond"><?php $key="teaser"; echo get_post_meta($post->ID, $key, true); ?></a>

    and in teh post custom field section add a field called teaser and just change whatever you want in this field, should work great :)

  13. vachi
    Member
    Posted 3 years ago #

    you don;t have to manually do anything, the custom field option will work, i use custom fields for many many thing on my site. form image links to posting code into posts

    http://codex.wordpress.org/Using_Custom_Fields
    you should really check it out great wp feature

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags