WordPress.org

Ready to get started?Download WordPress

Forums

Custom Template Page Help: Get data from a blog category into a page (4 posts)

  1. dementis
    Member
    Posted 8 years ago #

    From what I've read and from the freenode's #wordpress, I can do this with a *custom* Page Template - however I'm at a loss after reading the WordPress Docs, on exactly how to do it.

    Blog Category "A" content needs to be tossed into "WordPress Page A". So whenever Category A Blog is updated, the updated is dumped into "Page A" as well (but does not overwrite older entries - basically want a collection of everything from Blog A as a page). While everything from Blog Categories B, C, D... etc do not affect Page A. Would be preferrable just the body content only (skip the Title). It would be *perfect* if someone can supply a way to capture specific content from the Body too e.g. Links or Images posted in Blog Category A (and ignore whatever rant that was included).

    Additional info: the blog and target page are on the same site (its not a remote query from some place else).

    I could really really use some help here.

  2. dementis
    Member
    Posted 8 years ago #

    *sigh*
    Tried The_Loop examples as pages - but all it does is post the Page's Title/content.


    <?php
    /*
    Template Name: CategoryRipper
    */
    ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if ( !(in_category('2')) ) { ?>
    <div class="post">
    <h2><a>"><?php the_title(); ?></a></h2>
    <small><?php the_time('F jS, Y'); ?></small>
    <div class="entry">
    <?php the_content(); ?>
    </div>
    <p class="postmetadata">Posted in <?php the_category(', '); ?>
    </div>
    <?php } ?>
    <?php endwhile; else: ?>
    Sorry, no posts matched your criteria.
    <?php endif; ?>

    Instead of grabbing ANY of the possible categories at its disposal, it instead just spits out a Page with its Title and Content being what I inputed in Write Page (and selecting this template of course).

    This is what I'm getting:
    TitleTest
    February 22nd, 2006
    TestBody
    Posted in Uncategorized

    err.. right.. that's not what I wanted. I want to pull data from a blog category and store it on a Page. *sigh*

    *hits head on desk more*

  3. How is what you want different from a category archive page (small p)?
    Trying to understand why you're using Pages, is all.

  4. dementis
    Member
    Posted 8 years ago #

    not much except archives show all categories, and they only show either titles, or small exercepts from a blog category. I need the entire body every blog entry from Blog Category "A" in a Page for seperate viewing.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags