Support » Fixing WordPress » Automatic insetion of a “non-blank” excerpt into

  • Two things:
    1) A way to have the excerpt (if one exists) from a post show up as a pull quote in the post.
    2) The .css code to support the pull quote.
    I was able to include the following in index.php
    <div id=”pullquote”>
    excerpt();
    </div>
    and had some .css under “.pullquote” in my layout file. The code pulled the excerpt, and displayed it in the defined .pullquote .css code.
    But, how do I do it so that it does not include blank excerpts (which get pull quoted to the whole post instead)? I think some kind of loop to check for blank excerpts is needed, buy my PHP skills are sub-novice.
    And why won’t the darn font change for me in the .pullquote definition? Everything else works as it should, but the font won’t change it’s face. Here is the code for the .pullquote:
    .pullquote {
    float: left;
    width: 125px;
    font-family: Georgia, “Times New Roman”, Times, serif;
    text-align: left;
    display: inline;
    padding: 7px;
    background-color: #F1F1F1;
    border-color: #CCC;
    border-style: solid;
    border-width: 1px 0 1px;
    margin: 25px 10px auto 0px;
    font-size: 80%;
    }
    .pullquote:first-letter {
    font-weight: bold;
    font-size: larger;
    }
    Thank you very much for reading this and not yelling at me!

Viewing 7 replies - 1 through 7 (of 7 total)
  • I was looking at your page again, and you use a paragraph class instead of a div id. I think a class is the better way to go since, presumably, there will be more than one instance of the quote.
    I also wanted to ask if you tried to change the style in the actual index, instead of in the css. You might have a cascading issue.
    When you make your next pullquote (or edit an old one), try to <p style=”font-family: Georgia;”>
    If that works, you have something in your CSS over-riding your attempts to change the style. Being more specific in your CSS might help if that’s the case, as I think generally the more specific and the closer to the source the style info is, the more precedence it has.
    so you could add a p to your pullquote css property.
    .pullquote p {…}

    Arghnoname:
    Okay! Wow! I did checked everything out, and took your suggestions, and now all is working according to spec. Thank you very much!
    Now all I need is for someone with good php skills to show me how to leave the excerpt call out if there is no excerpt. Currently, if there isn’t one, then the first 251 (or so) words of the post get used instead. I just don’t know how to write the code for the check.
    But… thank you for the help with the .css portion of it!

    arghnoname:
    I tried those, but no joy.
    Oh well. Thanks for your efforts!

    I’ve been looking at some php books in the library, as learning the language is on my list of things.
    I think all you need to do is create a new function that will check the excerpt box and if null, then return nothing, and if not, then return your text as pullquote. It might take me a few days, maybe a whole week or two to learn how to do this simplest of functions.
    It’ll give me something to pop my php cherry on, so to speak, but you’ll have to bear with my slow ass. I’ll ask you for your index.php when I’m ready to give it a good go, if you don’t mind.
    I was hoping someone else would pop in and answer, but support around here, as with most free open source things, can be a little spotty.

    I was thinking more along the lines of:
    <?php if(get_the_excerpt()) echo ‘<div class=”pullquote”>’.get_the_excerpt().'</div>’; ?>

    oops, logged out since last night.

    Did I screw mine up? Should he use print $output instead of return $output?
    Thanks spartas for fixing up my really sloppy pullquote. I don’t know how I forgot to even define the class there.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Automatic insetion of a “non-blank” excerpt into’ is closed to new replies.