WordPress.org

Ready to get started?Download WordPress

Forums

Any php coders here? (14 posts)

  1. Chad_Coleman
    Member
    Posted 9 years ago #

    I want to use the excerpt tag, for a subtitle under each post.

    only, if i should choose not to use a subtitle/excerpt, i want nothing to appear, instead of the first paragraph.

    Anyone here know the proper way to write out the If - Else tag for this?

    much appreciated.

  2. Joshua Sigar
    Member
    Posted 9 years ago #

    I want to use the excerpt tag, for a subtitle under each post.
    a subtitle under the content? under the title?

    only, if i should choose not to use a subtitle/excerpt, i want nothing to appear, instead of the first paragraph.
    If you should choose not to use a subtitle ... when would that be?

    ...you want nothing to appear...nothing, nada, just a title and white blank space?

    ...instead of the first paragraph...so when you have subtitle, you want to have the first paragraph as well? and when no subtitle, no first paragraph?

  3. Chad_Coleman
    Member
    Posted 9 years ago #

    sorry. I guess I didnt explain well.

    but yes, the first two were correct.

    When I fill in the excerpt, I want it to appear. When I leave the excerpt field blank, I want to not have the first paragraph show, like it does by default.

  4. Joshua Sigar
    Member
    Posted 9 years ago #

    I want to not have the first paragraph show
    By "first paragraph" you mean fake excerpt?

    <?php the_title(); ?>
    <?php
    if( !empty( get_the_excerpt() ) ) { /* if I fill in the excerpt textarea */
    the_excerpt(); // then display it
    }
    ?>;

  5. Chad_Coleman
    Member
    Posted 9 years ago #

    hmm... that looks like it would be right..

    but I get this on my page when I use it.

    "Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/passth35/public_html/02/wp-content/themes/pta02/index.php on line 88"

    Line 88 = "if( !empty( get_the_excerpt() ) ) {"

  6. Joshua Sigar
    Member
    Posted 9 years ago #

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

  7. Chad_Coleman
    Member
    Posted 9 years ago #

    that one doesn't seem to work either :|

    the page shows fine, it just acts as if nothing is where the excerpt tag is...

    any more ideas?

    Thanks for the help you've been so far though.

  8. Joshua Sigar
    Member
    Posted 9 years ago #

    My bad, typo

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

  9. carthik
    Member
    Posted 9 years ago #

    Man walks into a bar and shouts, "Any beer lovers here?"

    :)

    Use better titles, Chad.

  10. Chad_Coleman
    Member
    Posted 9 years ago #

    alphaoide! It works!!!

    Yer the man! Thanks alot!

  11. Chad_Coleman
    Member
    Posted 9 years ago #

    Ok, now try this one on for size alphaoide... or... tell me if it's even possible...

    On pop up comments, when you click the comment authors URL, it opens in that same small sized window...

    I was thinkin it'd be sweet to give it a target=_blank attribute.

    How would I do that to this tag?

    <?php comment_author_link() ?>

  12. Antigone
    Member
    Posted 9 years ago #

    After much foul language and pulling of the hair, I was able to fix the author comment problem by using the following code in my comments-popup,php file:

    <a href="<?php comment_author_url() ?>" target="new"><?php comment_author()?></a>

    Crude. But it works. :)

  13. NuclearMoose
    Member
    Posted 9 years ago #

    Chad,
    Posting an effective question in the forums.

  14. Chad_Coleman
    Member
    Posted 9 years ago #

    understood. thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.