Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Extracting First Pragraph in a WordPress Post

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #29064

    here’s my issue.
    for the theme we’re building we cant use the more or excerpt features in wordpress. the whole post needs to be typed into the content area as a whole.

    we created a custom loop using query posts so that the most recent post in a category, that has the tag "featured" will appear in the featured area. all other posts are just headlines until you click on the more link. when clicking on more, regardless of styling, the full post is revealed on that same page. you never go to the single.php file.

    i need to extract everything within the first "<p>" "</p>" tags, display it under the headline next to the featured post image, and then when clicking "more" NOT show it in the expanded content area. here are some screen shots.

    [img]http://img.skitch.com/20100517-brh8qmrdj8gs4imh776ejd5sfj.jpg[/img]

    [img]http://img.skitch.com/20100517-dmgwupda5ebsm4a238sntmbipj.jpg[/img]

    as you can see in the first image. the featured post is comprised of a featured image/thumb nail. date, headline and intro paragraph.

    the second image when more is clicked the whole post is revealed.

    currently that paragraph is hard coded into the theme and the latin is in the post.

    once the post cycles to the styling below it needs to behave normally. While in the featured position however the first paragraph needs to be shown under the headline, and NOT shown in the area that expands when clicking more.

    hopefully thats not too confusing and makes sense.

    if anybody has any idea how to do this i would appreciate it. i’m also not using the traditional WP loop. we’ve created our own for some of the pretty unique needs of this theme. its serving more of a CMS than blogging purpose. here’s the code i’m using:

    Code:


    ‘,”,’

    ‘); ?>

    This is where the first paragraph from the post will go. Currently hard coded into the WP theme for styling. Needs to extract the the first paragraph from the featured post, and not show it when clicking on more.

    More

    0 && $postcount <= 8 ) { //GETS MORE EXCERPTS ?>

    id=”headline-“>


    ‘,”,’

    ‘); ?>

    day”>

    More


Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.