WordPress.org

Ready to get started?Download WordPress

Forums

Show Headline - Last post in that category with image - think Arthemia (4 posts)

  1. dazkeirle
    Member
    Posted 4 years ago #

    Hi there,

    I have used Arthemia for years and love the way it displays a headline however as I'm now building a cleaner, far simpler template I don't need the full features of Arthemia but would like to keep the concept of a headline excerpt.

    Is there any way to pull the excerpt from the last post marked in the category "Headline", along with any thumbnail image associated, and display is globally across the site as a banner in the template?

    see here as an example: http://demo.colorlabsproject.com/arthemia/

    I just need the code for the Headline bit, not the featured etc.

    Thanks so much.

  2. kz
    Member
    Posted 4 years ago #

    query_posts('cat=123&showposts=1'); // replace 123 by category ID of "Headline"
      if(have_posts()) :
        the_post();
        $images = get_children(array(
          'post_parent' => get_the_id(),
          'post_type' => 'attachment',
          'post_mime_type' => 'image',
          'orderby' => 'ID',
          'order' => 'ASC',
          'numberposts' => 1
        ));
        foreach((array)$images as $key => $image){
          echo wp_get_attachment_image($key);
        }
        the_excerpt();
      endif;
    wp_reset_query();
  3. dazkeirle
    Member
    Posted 4 years ago #

    thanks very much, works prefectly

  4. halcyonblog
    Member
    Posted 4 years ago #

    Hi there, I've been using Arthemia for some time now and would like to emulate the right side 'Featured' area with the up/down arrows and automatic scrolling show here: http://demo.colorlabsproject.com/arthemia/
    I was hoping you guys could give me a bit of direction as to where I need to place the code.

    Any help would be greatly appreciated!

    Best,
    R

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags