WordPress.org

Ready to get started?Download WordPress

Forums

Link Categories to Pages? (25 posts)

  1. FangedFreak
    Member
    Posted 3 years ago #

    So i've just created a website using WP, and i've made a few categories and then pages with the same category names

    I write a new post and put it into a category (i.e. Music) and then when i click on my Music Page, its blank

    How can i change it so that when i click on my Music page, the post will be there? Please explain in as detailed way possible haha

    Thanks!!

  2. I write a new post and put it into a category (i.e. Music) and then when i click on my Music Page, its blank

    That shouldn't happen. When you click the category you should see all posts in that category.

    Try first switching to the Twenty Ten theme and try again to rule out a problem with your theme files.

  3. esmi
    Forum Moderator
    Posted 3 years ago #

    I'd also suggest that you avoid giving Pages, Tags and Categories the same names.

  4. FangedFreak
    Member
    Posted 3 years ago #

    I'm using the Twenty Ten theme.

    If i click on the music page, the url is example.com/music

    but the post i made in music is example.com/category/music

    thnx

  5. esmi
    Forum Moderator
    Posted 3 years ago #

    Posts are listed in Categories - not Pages - by default.

  6. FangedFreak
    Member
    Posted 3 years ago #

    So how do i make it so a list of the music posts will appear on a Music page?

  7. esmi
    Forum Moderator
    Posted 3 years ago #

    WordPress does this automatically, Try clicking on the category link in any one of your existing posts.

  8. You mean that you want a page with some information at the top and then below that a list of your music posts?

    As esmi says, posts are listed on the dynamically generated cateorry page by default - not a WordPress Page you created. (Sorry, I read your initial post too quickly.)

    One easy workaround is to use the category description field to add the info you want to appear above the list of posts. Then add a line to your category.php to display the category description.

    <?php echo category_description(); ?>

    Don't edit the default Twenty Ten theme, though, or your changes will be overwritten when there's an update - create a child theme instead.

  9. FangedFreak
    Member
    Posted 3 years ago #

    Ok so how can i get that link to show as a Category at the top of my website?

  10. Ganners
    Member
    Posted 3 years ago #

    It sounds to me like maybe you want your categories to appear in your horizontal navigation bar. In which case I suggest you take a look at opening up your header.php where this is found and swapping wp_list_pages for wp_list_categories?

  11. esmi
    Forum Moderator
    Posted 3 years ago #

    @Ganners: That's bad advice. You shouldn't edit Twenty Ten!

    @FangedFreak: Navigate to Appearance->Widgets and drop the Category widget into the primary sidebar.

  12. FangedFreak
    Member
    Posted 3 years ago #

    @Ganners Yeh i want my categories in the horizontal navigation bar

    @esmi thanks but like i said above.. want them in the navigation bar

    @zoonini thanks for the link

  13. Ganners
    Member
    Posted 3 years ago #

    Yeah sorry, that is true, If I am correct in suggesting you want the categories to appear in the horizontal bar then I suggest duplicating twenty ten, renaming the folder and rename the theme in styles.css.

  14. You can also go into Appearance > Menus - and set your desired categories to appear in the navbar there. No theme editing required.

  15. FangedFreak
    Member
    Posted 3 years ago #

    @zoonini

    Thanks for the tip about menus, i've put my categories in a new Menu but i dont see how i can make it work?

    Sorry... dont have any experience of using WP from scratch

  16. I don't have Twenty Ten installed anywhere myself, but I assumed it came with a default menu? You'll need to edit the existing menu, not create a new one.

  17. FangedFreak
    Member
    Posted 3 years ago #

    No there wasnt a default menu there, so i had to create one

  18. Ah - well then this method won't work without editing the theme files, as you'll need to replace the existing menu with this new one.

  19. FangedFreak
    Member
    Posted 3 years ago #

    DOH!!!!!!!!!!!!!!!!!!

    ok i now have no idea what to do :'(

  20. A few options:

    1. Learn more about creating child themes and make the necessary code edits yourself - it's not too difficult if you don't mind editing some code

    2. Hire someone to make the tweaks you want for you

    3. Live with the categories in the sidebar

  21. esmi
    Forum Moderator
    Posted 3 years ago #

    You need to create a child theme with a modified callback in functions.php for wp_nav_menu so that it uses wp_list_categories rather than the default wp_page_menu.

    Or try using another theme - such as Twenty Ten Weaver.

  22. Maybe someone who knows more about Twenty Ten than I do can confirm how the menu system works - I just looked at this article and it seems to show the custom menu overriding the default, and doesn't mention code edits.

    http://www.makeuseof.com/tag/customizing-twentyten-theme-wordpress-30-blog/

  23. FangedFreak
    Member
    Posted 3 years ago #

    Thanks guys, i'll look into creating a Child Theme

  24. esmi
    Forum Moderator
    Posted 3 years ago #

    @zoonini: There is only a single custom menu location in Twenty Ten - in the sidebar.

  25. @esmi - OK, thanks! I should set up a test install of Twenty Ten sometime so I can help people better. ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic