Boat Drinks  

Go Back   Boat Drinks > General > Computer and Consoles

Reply
 
Thread Tools Display Modes
Old 18-05-2008, 16:32   #1
divine
Moonshine
 
divine's Avatar
 
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
Default Wordpress/PHP Help - Grid/Catalogue/Sitemap

What I basically want to achieve is a page that shows all the posts on the site, in a grid preferably, with just a title and maybe a picture.

So far, this seems like the best sounding solution but I can't for the life of me make it work, probably because I don't understand PHP in the slightest.

I get as far as;
Quote:
Step 4) Use the code below on the template of your category page (in yourdomain.com/wp-content/themes/yourtheme/category.php).
before I get stuck. Mainly because I don't have a category.php page. Nor does any other theme I recall using.

So, thinking logically I made a page called category.php and pasted that code into it but that doesn't really work. It just shows a grid on it's own, away from the actual site. So i'm guessing I either need other code in that category.php page or I need to put that code elsewhere...

Anyone reckon they might be able to help or know of an easier way to achieve what I want?
__________________
divine is offline   Reply With Quote
Old 18-05-2008, 17:09   #2
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

Given the age of that post I'd guess those instructions are for a specific version of Wordpress - one that is old, and that you don't have.

Do you have a page that is equivalent to the one they're suggesting modifying? If so, it shouldn't be too hard to work out which .php file that page is produced by and modify it (backup first - if one detail is wrong for your version then chances are other details are wrong too).
Mark is offline   Reply With Quote
Old 18-05-2008, 17:44   #3
divine
Moonshine
 
divine's Avatar
 
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
Default

I currently have:

archive.php
comments.php
footer.php
functions.php
header.php
index.php
searchform.php
sidebar.php
single.php
__________________
divine is offline   Reply With Quote
Old 18-05-2008, 19:49   #4
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

Looks like a pretty basic style - no candidates there I'd expect. Best I can suggest as a non-Wordpress user is to copy one of the existing pages and replace it's content with what you want. Not ideal. I'm sure someone with Wordpress experience could do better.
Mark is offline   Reply With Quote
Old 18-05-2008, 23:35   #5
divine
Moonshine
 
divine's Avatar
 
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
Default

Right, sorted the grid bit now.

Next issue. How can I limit the length of a string PHP is calling?

Code:
<?php the_content('Read the rest of this entry &raquo;'); ?>
I'm guessing that is the line in the code that goes and finds the contents of the post and displays it. How would I go about making it so that it only shows 100 characters for example? Maybe even terminating it with [...] or something if that's an easy addition

I found some stuff about $limit but I can't get my head round the examples on sites as they seem to be using it differently.
__________________
divine is offline   Reply With Quote
Old 19-05-2008, 00:20   #6
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

Since I can't see the code, I can't answer that, but here's somewhere to start...

http://uk.php.net/substr

Mark is offline   Reply With Quote
Old 19-05-2008, 00:34   #7
divine
Moonshine
 
divine's Avatar
 
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
Default

Code:
<!--content text -->
<div class="content_text">
<?php the_content('Read the rest of this entry &raquo;'); ?>
<br />
<br />
										
<div class="clear"></div>
</div>
<!--content text end-->
I'm guessing seeing as everything is between those comments, that must be all that's related to the post content, which makes sense as before that is the title/date and afterwards is the comment/nav stuff.
__________________
divine is offline   Reply With Quote
Old 19-05-2008, 00:47   #8
Mark
Screaming Orgasm
 
Join Date: Jul 2006
Location: Newbury
Posts: 15,194
Default

Nope - the relevant bit seems to be in a function hidden away somewhere else in Wordpress. See if you can find out what 'the_content' does (it looks like a function).
Mark is offline   Reply With Quote
Old 19-05-2008, 01:52   #9
divine
Moonshine
 
divine's Avatar
 
Join Date: Sep 2007
Location: Southampton
Posts: 3,201
Default

Ah good call

Found this; http://codex.wordpress.org/Template_Tags/the_content

Sorted now, cheers
__________________
divine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 13:23.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.