WordPress.org

Ready to get started?Download WordPress

Forums

Getting Started with Pages vs Posts vs Categorys. Help! (15 posts)

  1. steverobertsco
    Blocked
    Posted 3 years ago #

    Hi all. Im a web developer, I know my html's, my css's, my php's and very familiar with my cba's and my fuc and k's with a degree for punching monitors and tearing up reference books.

    So. Im new to WordPress. I have worked with it on a job with someone else (who knows wordpress), I have had a fair bit of time playing around with it and I own a copy of the WordPress for Dummies book. Now I need to use it for a company I am working with.

    What they want is a very simple news page. I am really trying to understand Pages, Posts and Categorys. I think I understand that a page is just a static page as like another web page.

    As for Categorys, I just don't understand, there doesnt seem to have much options there with them.

    And a post is the main conetent, posts are used to publish content.

    * They want a very simple one page where it shows up news items, like an introduction into that news item with a link.
    * That news item then links to a seperate page where it shows the rest of that news item.
    * I would like on the first page to have all these news items listed in an archive by month. So when you click on that month it shows up all the news items in that month and year.

    I have built the template myself including the rest of the site. The news page is found at http://intertech-new.eyepreview.co.uk/blog/ if you wish to look.

    Can anyone help me, I just really need to know the basic and how to get started. I hav read forums, tutorials and gone through my wordpress for dummies book and it just doesnt fit. Please help. Thank you everyone, anyone who does in advance and I will thank you and discuss my progress with you along the way. Thank you.

  2. steverobertsco
    Blocked
    Posted 3 years ago #

    Just to go back on the specifics of what I want to give you an idea of where I am and what I am trying to achieve.

    The homepage (news page) would have small new items on the left, with a summary of that news item, including a link which will link to a seperate page for that news item with the rest of the story.

    The homepage (news page) on the right would have categorys of news items listed like so:

    January 2011
    February 2011
    ... etc.

    I have already achieved that with this code.

      <?php wp_get_archives('type=monthly'); ?>
    .

    But I want it so that when a month is clicked, it brings up a seperate page with all posts in that month and year.

    I have already placed in the php into the template. I have the following as default templates:

    * Main Index Template
    (index.php)
    * Page Template
    (page.php)
    * Archives
    (archive.php)

    I really hope someone can help me and fast. I have a week to do it. :(. Thank you in advance.

  3. degamer12
    Member
    Posted 3 years ago #

    The way I always do this is to use a costum template with a costum loop in it. You can find information about creating a costum template on this page

    First create a category for posts where all the nieuws items are put it.
    Then on in your custom template use a costum loop where you call all the items from that category. This is done by using the following code:

    <?php
    $second_query = new WP_Query( array( 'cat' => '4' ) );
    			while( $second_query->have_posts() ) : $second_query->the_post(); ?>
    			<div class="homepost">
    				<div class="title"><?php the_title(); ?></div>
    				<div class="excerpt"><?php the_excerpt(); ?></div>
    			</div>
    			<?php
    			endwhile;
    			wp_reset_postdata();
    			?>

    Change the number 4 to the number of your category. Then as last select your custom template as template for your news page.

    I hope you understand what I mean.

  4. steverobertsco
    Blocked
    Posted 3 years ago #

    @degamer12 Thanks for the quick reply and the help. Is there a
    <?php missing there. Im getting an error when I paste that in my template?

    Also can I get any help with the rest of the info anyone? A real dumb persons guide will help me, the dumber the better as I am a dumb wordpress person. and one day hope to be the one answering the questions.

  5. steverobertsco
    Blocked
    Posted 3 years ago #

    @degamer12 Thank you. I sorted that one problem out. That helped a lot. I now have on the homepage all the latest news items one after the other on that page.

    Now all I need is help with the rest. Any help?

  6. steverobertsco
    Blocked
    Posted 3 years ago #

    @degamer12 and everyone else: So that is one issue resolved, were on a role.

    * On a news item on the first news page, How can I click a link so that it shows up a page with the rest of that story? I want it so that that news item then links to a seperate page where it shows the rest of that news item.

    * When I click a month on the right, it shows only one post from that month. Any help on having that month show all posts from that month?

    Thanks for the help so far @degamer12.

  7. degamer12
    Member
    Posted 3 years ago #

    1. Normally, the excerpt won't place a read more link. This can be overwritten by placing the following code into your theme's functions.php

    function new_excerpt_more($more) {
           global $post;
    	return '...<a href="'. get_permalink($post->ID) . '">Read More</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    2. Are you sure you have publiced more then 1 post in each month ? Because when I click on the news page I also just see 2 posts.

  8. steverobertsco
    Blocked
    Posted 3 years ago #

    1. That worked great. Thank you

    2. I have written two news items for June and have looked. Both items are there. But... (Just to be annoying) I would like the monthly news items to be like the first page and just list a summary with a read more on them pages. So I would think to just place in the same code in a template for those pages but of course they don't have pages. Would this be possible?

    Thank you for everything so far.

  9. steverobertsco
    Blocked
    Posted 3 years ago #

    1. That worked great. Thank you

    2. (Just to be annoying) I would like the monthly news items to be like the first page and just list a summary with a read more on them pages. So I would think to just place in the same code in a template for those pages but of course they don't have pages. Would this be possible?

    3. When I click a news item. Where does it exactly go to. When a news item is clicked, it does go to its own page but I want some style to that page, I'd wish it to look like the other pages within the blue box.

    Link: http://intertech-new.eyepreview.co.uk/blog/

  10. degamer12
    Member
    Posted 3 years ago #

    Isn't that achive.php that you need to change then ? Otherwise try to look if you can get it to work with the help of conditional tags. You can find them on this page.

    3. Probably single.php or post.php. Just try them out.

    Quick notice about the site: You are missing the footer on the homepage ;).

  11. steverobertsco
    Blocked
    Posted 3 years ago #

    Ok, Cool. Its Archive.php. So to edit the template / page for the individual item, I would edit Archive.php. Although I thought it would be Single.php.

    Now all I need to do is style that page because for some reason it is not loading the Masthead or the Logo at the top of the page but I know the Header.php is ok.

    Also when I click the months on the right, it would still be good to have them like the first page in news summary items, So I will venture on and find out how to do that.

    Thank you for all your help so far degamer12. Its a blessing that you was online today. What would be a few days work of trying to figure this out has been done within a couple of hours. Thank you.

    Link: http://intertech-new.eyepreview.co.uk/blog/

  12. degamer12
    Member
    Posted 3 years ago #

    No problem. I am really bored at work atm so haha. Please put the topic on Solved. You can find that in the right menu next to all these posts.

  13. steverobertsco
    Blocked
    Posted 3 years ago #

    Thanks degamer12. Will do. Yeah me too. I work for that (InterTech) company as a freelancer at the moment developing there website(s). Four more to go, but those will be simple template sites, no cms, no wordpress I think.

    All the best in all your ventures.

  14. steverobertsco
    Blocked
    Posted 3 years ago #

    Ive deleted this as I have posted it as a new question. I think it is relevent. Thank you.

    New post here:- http://wordpress.org/support/topic/page-templates-vs-categories?replies=1

  15. steverobertsco
    Blocked
    Posted 3 years ago #

    New Problem:

    I have now turned this news page into a whole cms site with posts on other pages all over the place. How do I get the news page just to display the latest 10 news posts on the right, not every post from every page.

    Here is the code I had put in originally on the right to display the latest 10 posts:

    <h2>Last 10 Posts</h2>
    <ul>
    <?php wp_get_archives('type=postbypost&limit=10&format=custom'); ?>
    </ul>

    Any help? Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic