Forums

[resolved] How TO add Posts Into a Page (11 posts)

  1. thetmyster
    Member
    Posted 2 years ago #

    Hi all, I Have a Blog and i want to have a Freebies page, but i want to be able to post into a page ive googled and found : http://wordpress.org/support/topic/241644?replies=8

    but i do not understand how to do this can somone give me a guide on how to do this with the templates? So i can post to a page.

    Thanks, T

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    You could apply code such as suggested here.
    http://wordpress.org/support/topic/276775?replies=6

    Of course just modify the WP_Query part to query the posts you want, and add HTML etc...

    For example : WP_Query('cat=4'); would grab the posts from category with the ID 4.

    Required info is all there, just modify the areas as required...

  3. thetmyster
    Member
    Posted 2 years ago #

    Part 2 the code is expried :P

    Can you re-post?

    and i do want to pull from a category, but can i hide it so the freebies are only in the freebies page?

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    Sorry, could have sworn i selected a month when creating the pastebin...

    Here's the code again though, however you will need to add to it (HTML/CSS) and modify as required.

    http://wordpress.pastebin.com/m6c979886

    It was written for the guy in the other thread, but the same rules apply in any case... :)

  5. thetmyster
    Member
    Posted 2 years ago #

    ok, now i cant get the option for custom template

  6. thetmyster
    Member
    Posted 2 years ago #

    ok i got the template but how do i defien the post category

  7. Mark / t31os
    Moderator
    Posted 2 years ago #

    Just go and create a post as you usually would (under "Posts" and "Add new")..

    All you need to do with the template is create a page, any name (no content in the actual page required), attach the template (from the right), save then go about adding posts, in the normal manner..

    The page template is basically acting as a framework to grab a select group of posts...

  8. thetmyster
    Member
    Posted 2 years ago #

    But how do I select the gruop to pull?

  9. Mark / t31os
    Moderator
    Posted 2 years ago #

    By modifying this part.

    WP_Query();

    http://codex.wordpress.org/Function_Reference/WP_Query
    http://codex.wordpress.org/Template_Tags/query_posts

    Example:
    WP_Query('cat=4');

    Grabs post from category with the ID 4.

  10. thetmyster
    Member
    Posted 2 years ago #

    so for the freebies on my site, maxTuts.co.cc

    in catogory free WP_Query(category/free);

    for my category free

    would pul from http://maxtuts.co.cc/category/free ?

  11. Mark / t31os
    Moderator
    Posted 2 years ago #

    Read the links i provided...

    A valid example was given.

    WP_Query(category/free); Would not work, it's invalid...

Topic Closed

This topic has been closed to new replies.

About this Topic