Hi guys I am trying to figure out how to generate a list of all the games on my website and plant them on one of my pages. I want to list them alphabetically and just have the title and the link to the posts. Thanks Guys!
I have posts on the games which lead to other articles on that game or similar. So I put them in a category of "Games" that way whenever someone opens the games tab they see the latest etc.. but I want to create a page that will list all the games ever put up on 1 page for instance <a href="#">Title of Game 1 in Category Games</a> <a href="#">Title of Game 2 in Category Games</a> <a href="#">Title of Game 3 in Category Games</a> <a href="#">Title of Game 4 in Category Games</a>
I'm guessing that GamerCity.co.uk is the site in question? That's Wordpress, so you're looking at something like this: <?php $query = new WP_Query('category_name=games&showposts=-1&orderby=title&order=ASC); while ($query->have_posts()) : $query->the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <br/> <?php endwhile; ?> PHP: If you need that code to execute on a Wordpress page (one you create via the admin panel), you should try http://wordpress.org/extend/plugins/exec-php/ , which'll let you run PHP code in your pages.
You could also add a shortcode tag and run wogans code from that (just put the shorttag in the page you want it on) http://codex.wordpress.org/Shortcode_API
Aha, now that IS clever... And all you'll need to do is drop that PHP into functions.php for the theme...
Ok so I installed the plugin you mentioned. And pasted the code into my page, as well as changing the category to its name. But it doesn't seem to work as no titles are coming up at all.
You have error reporting turned off. There's a missing ' at the end of the first line: ...title&order=ASC'); Code (markup): Just tested the fixed version on my blog and it seems to work.
Your a genius! Thanks a lot! Btw is there any good sites that you can recommend that will teach me php?