Support » Fixing WordPress » Archive Page To Show Main Page Post and Category Posts?

  • Hi

    Can anyone tell me if it’s possible to create an archive page as an actual dedicated page (e.g wedding-archive.php) which allows for a user to post the main text at the top (like other static pages).

    Then also show posts below from a category set as wedding-details (id=6), which contains individual postings like normal.

    All i seem to get at the moment is the main page text (post) repeated. i hope that makes sense.

    Thanks

    James

Viewing 12 replies - 1 through 12 (of 12 total)
  • Sounds like you need a category page, not an archive page: Category Templates « WordPress Codex

    Thread Starter jimzippy

    (@jimzippy)

    Hi,

    I did look at the category page in the codex, but this appeared to only allow static text placed at the top and not dynamic, but i may have miss read that?

    Category templates allow both static text and dynamic posts: Category Templates: What_categories_do_you_show_to_the_visitors

    Thread Starter jimzippy

    (@jimzippy)

    Hi,

    sorry, what i mean is that i have two lots of dynamic text that need to be shown on that page. The main post created for the page (as in the page post) but i also want to show the separate posts for the category.

    As far as i can see a category page will still only show the main post or category posts and not both, unless i include one as static text – which i do not want to do.

    I hope that makes sense or if i have missed something please feel free to point it out as i’ve been scratching my head for hours on this, lol

    thanks for your help

    If I understand you correctly you want to have a page which displays the main post followed by a series of archived level post links. Is this correct? If so then it is possible.

    You basically will need to create a category archive page with the newest post showing full content instead of an excerpt. Does that make sense?

    I think you can find what you’re looking for here. Look for the heading Showing Excerpts or Full Post Depending Upon Number of Posts
    Also, at the bottom of the page there are some additional links to articles which explain the process further.
    Hope this helps

    Thread Starter jimzippy

    (@jimzippy)

    Hiya,

    Sort of, i get the feeling i may be asking wordpress to do to much, lol (i am quite new to it!).

    I have tried creating a page with it’s own template e.g wedding-photos. This page is editable through wordpress as a “created page” under the WP menu of “Pages”. I can then change the intro text here.

    Then below that i have the posts from a category called wedding-photos which should in theory display a thumbnail photo and a short description – these are posts edited under the WP “Posts” menu.

    Therefore, this one page should have both sets of posts considering they both use > if have Post() then do > but because these (i think) are technically both classed as posts wordpress just overrides the second set of thumbs and posts and repeats the main intro post again and again…

    I copied the archive.php page and took the top section from page.php
    and then changed the page template name to “wedding-photos” – but maybe this is incorrect anyway???

    Thanks for all your support

    If you just want a listing of the wedding-photos category with thumbnails and excerpts you can create an archive page just for that category. Then you can add static texts at the top of the page as long as you do it outside of the loop.
    But you have to add the static text in the template file (i.e. wedding-photos.php) of the page. Can’t do it via the page edit view. Additionally, this will eliminate the need for creating a static page.

    Does that make sense? The page I linked to in my prior post has explanations for how this can be done.

    Thread Starter jimzippy

    (@jimzippy)

    Hiya

    Yes, i took a look at that link and that did make more sense than most, however i’m trying to steer clear of adding static text as it needs to be editable as much as possible through WP for the client… which is a pain in the a*se.

    I’ve tried pulling post data based on a post_page(); query then running another query later for the category posts but it’s still the same issue of a repeated page post.

    Thanks again

    You can create a call of another page.php template file to post at the top of the page. This page can be used for editable text. I’ve done it before and should have thought of this method first.

    Basically you insert that page.php file to be called at the top of the page in the same manor that the header.php file is called. As a matter of fact you should place that call right after the header is called.

    The page is editable through the standard text input in the admin panel just like any other page. It just has to be based off your new page template.

    Thread Starter jimzippy

    (@jimzippy)

    Ah, that’s genius, yep i can see how running that bit as it’s own include/call function should work.

    I’ll give that ago, is it just a case of writing:

    get_page({page-name-here});

    ? or am i not even close lol, thanks

    Yes. I believe that’s how it should work.

    It’s based off of how they created this theme. http://branfordmagazine.com/

    You may wish to download it an examine how it was designed.

    Best wishes

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Archive Page To Show Main Page Post and Category Posts?’ is closed to new replies.