• 0

Help with Wordpress...


Question

Hi,

I want to start a website and have looked at both joomla and wordpress. I know practically nothing about building sites so would like a little advice.

I would like to have different pages, for example 'About Me' 'Photos' 'Music' etc etc. In Wordpress I have tried to find a simple black theme and am using this one at the moment. http://wordpress.org/extend/themes/pyrmont-v2

The problem is that I can create a new page, but I can't post to it. The only option I seem to get is for posts to be published to the home page.

Am I missing an option, or is wordpress not designed for what I would like to do? Should I be posting everything to the blog and then using categories or tags as if they were links to different pages?... if that makes any sense.

Thanks for any help.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Wordpress can have pages and posts. Pages are like what you described such as the about page. You just click add new page on the admin navigation. they should be added to your navigation bar automatically, if they arent then check out the menus section where you might have to add it yourself (menus are under appearance in wordpress 3.0) assuming that the theme creator set it up as a dynamic menu.

posts appear on your blog. dont use them for pages.

read more about wordpress here

Also if you want your blog to be on a different page to your homepage under settings go on reading and change which page you want them to appear on

Link to comment
Share on other sites

  • 0

Thanks.

So you can't make posts on individual pages? For example if I wanted a photos page and wanted to update it, i'd update the whole page rather than add a post to it like I would on the blog/home page?

sorry for the basic questions, i've been reading up a bit and playing around but i'm still a little lost. I'll check out the link also, thanks.

Link to comment
Share on other sites

  • 0

I've been trying to get this working recently myself. You can do it with PHP.

Search WordPress help for Page of Posts.

I haven't had much luck with it yet, but if you have a lot of experience with PHP it should be simple.

Link to comment
Share on other sites

  • 0

Pages are just that - a page with text that remains text that you write.

Posts are posts, which can be in categories.

If you want a page of all posts tagged as "Photos" that is possible.

Link to comment
Share on other sites

  • 0

okay, i think im beginning to get my head around this now. I think I need to look at 'categories' like links to a new page where the specific info regarding photos will be kept, rather than looking to have a new page for them.

Link to comment
Share on other sites

  • 0

Alright, so essentially you want to have a page called "photos" to be access like maybe domain.com/photos? And you want to be able to create posts under a subcategory called "Nature" under the parent category "Photos"?

What you will need to do is create a Page Template and name the file as photos.php and add that to your theme file. The easiest way to do this is to copy the page.php file to your computer, rename it to photos.php and then open it up in an code editor (Notepad++, Dreamweaver, Coda, et al.)

The following needs to be added before the header (<?php get_header(); ?>). I looked your theme exactly so all you need to do is rename "Page Template" (next to Template Name) to "Photos Query."

&lt;?php
/*
Template Name: Photos Query
*/
?&gt;

Now, we're going to remove the query that calls up content for "Page." We don't want that as we're just going to query your photo posts here instead.

So remove the following snippet:

   	&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
			&lt;div class="post" id="post-&lt;?php the_ID(); ?&gt;"&gt;
				&lt;div class="date"&gt;
					&lt;?php the_time('Y') ?&gt;&lt;br /&gt;
					&lt;?php the_time('m.d') ?&gt;
				&lt;/div&gt;
				&lt;div class="title"&gt;
					&lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php _e('Permalink to: ', 'pyrmont_v2'); ?&gt;&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;

					&lt;div class="postmeta"&gt;
						&lt;?php _e('Category', 'pyrmont_v2'); ?&gt;: &lt;span class="category"&gt;&lt;?php the_category(', ') ?&gt;&lt;/span&gt; /
						&lt;?php
							$tag = get_the_tags();
							if(!$tag){
								echo __('Tags: no tag /', 'pyrmont_v2');
							}
							else{
						?&gt;
						&lt;?php _e('Tag', 'pyrmont_v2'); ?&gt;: &lt;?php the_tags('&lt;span&gt;',', ','&lt;/span&gt;'); ?&gt; 
						&lt;?php } ?&gt;
						&lt;span class="comments"&gt;&lt;a href="#respond"&gt;&lt;?php _e('Add Comment', 'pyrmont_v2'); ?&gt;&lt;/a&gt;&lt;/span&gt;
						&lt;?php edit_post_link(__('Edit', 'pyrmont_v2'), ' / ', ''); ?&gt;
					&lt;/div&gt;&lt;!-- end postmeta --&gt;
				&lt;/div&gt;&lt;!-- end title --&gt;
				&lt;div class="clear"&gt;&lt;/div&gt;

				&lt;div class="entry"&gt;
					&lt;?php the_content('Read More &gt;&gt;'); ?&gt;
					&lt;div class="clear"&gt;&lt;/div&gt;
				&lt;/div&gt;&lt;!-- end entry --&gt;
			&lt;/div&gt;&lt;!-- end post --&gt;

		&lt;?php comments_template(); ?&gt;
		&lt;?php endwhile; ?&gt;

		&lt;?php else : ?&gt;
	    	&lt;div class="post"&gt;
				&lt;div class="title"&gt;
					&lt;h2&gt;&lt;?php _e('Sorry, nothing found!', 'pyrmont_v2'); ?&gt;&lt;/h2&gt;
				&lt;/div&gt;
				&lt;div class="clear"&gt;&lt;/div&gt;
				&lt;div class="entry no_result"&gt;
					&lt;p class="no_result"&gt;&lt;?php _e('Please use the search function, or visit the archives page.', 'pyrmont_v2'); ?&gt;&lt;/p&gt;
				&lt;/div&gt;
			&lt;/div&gt;&lt;!-- end post --&gt;
		&lt;?php endif; ?&gt; 

Now your photos.php should look like:

&lt;?php
/*
Template Name: Photos Query
*/
?&gt;

&lt;?php get_header(); ?&gt;
&lt;div id="container"&gt;
    &lt;div id="main"&gt;

    &lt;/div&gt;&lt;!-- end main --&gt; 
&lt;?php get_sidebar(); ?&gt;
&lt;div class="clear"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;!-- end container --&gt;
&lt;?php get_footer(); ?&gt;

So what we're going to do now is create a custom query to call up your photos. I am not going to do 100% of everything for you as there will need to be some custom work involved here but I will just get you pointed to the correct direction ^_^.

So we're going to use this:

&lt;?php query_posts('cat=4&amp;showposts=-1'); while (have_posts()) : the_post(); ?&gt;

&lt;?php endwhile; ?&gt;

So what you see above is just the start and end of the query. I am querying a category with the ID '4' (this is just an example number) and I am showing infinite posts. To use your "Photos" category you would want to go into your 'Categories' page and hover over the 'Photos' cat and in the URL you will see the ID. Just toss that ID into the query to replace '4.' So now this will grab ALL photos you post under there.

The tricky part now is what data you want to show with your query. Essentially now you are using anything that the post loop has.

So for example we can do:

&lt;?php query_posts('cat=4&amp;showposts=-1'); while (have_posts()) : the_post(); ?&gt;
&lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php _e('Permalink to: ', 'pyrmont_v2'); ?&gt;&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;	
&lt;?php endwhile; ?&gt;

That will just show every post under 'Photos' as just a permalink title.

Link to comment
Share on other sites

  • 0

Continuing my post since I didn't want to lose it.. this should auto merge, hopefully! :D

So this is where you will really need to work on how things are going to be displayed. It will take a little more effort/time on your part. We can either use post_thumbnail to show thumbnails of your images or you can utilize a custom field that you will use in your query.

What you can do is create a custom field labeled "photo_url" and in it you will copy/post the entire URL to the photo used in that post. So if it's domain.com/wp-content/uploads/baby-on-a-boat.jpg then you will have that entire URL in the custom field for "photo_url". Now that you have that we can toss that into our query to test it out.

To call the custom field, you use get_post_meta to call your custom fields. So we will be using the following to call photo_url:

&lt;?php if ( get_post_meta($post-&gt;ID, 'photo_url', true) ) : ?&gt;
    &lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;
        &lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, 'photo_url', true) ?&gt;" alt="&lt;?php the_title(); ?&gt;" /&gt;
    &lt;/a&gt;
&lt;?php endif; ?&gt;

I set the get_post_meta in an if statement so that if you forget to add an image to photo_url, it will not display for you. Alternatively, you can remove the if/endif and just keep the <a href... to </a> instead.

So now we will put that into our query:

 &lt;?php query_posts('cat=4&amp;showposts=-1'); while (have_posts()) : the_post(); ?&gt;
&lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php _e('Permalink to: ', 'pyrmont_v2'); ?&gt;&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;        
&lt;?php if ( get_post_meta($post-&gt;ID, 'photo_url', true) ) : ?&gt;
    &lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;
        &lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, 'photo_url', true) ?&gt;" alt="&lt;?php the_title(); ?&gt;" /&gt;
    &lt;/a&gt;
&lt;?php endif; ?&gt;
&lt;?php endwhile; ?&gt;

So now our query will show the post's permalinked title and a custom field using the post's photo. But we don't want the fullsize image being used. We want to use a thumbnail. However, we don't want to force a width/height using html in the img tag or use CSS. It will have longer page loads to resize and the image might look more distorted than we want.

Instead we're going to use a script called "TimThumb." You will download the source and save it as timthumb.php then upload that to your theme directory. It should look like wp-content/themes/theme_name/timthumb.php once you upload it.

What this does is dynamically generate (then save in cache) a thumbnail image for the URL it's attached to. It can be uniquely positioned to grab the top part of an image, middle, or bottom part. You can also apply various filters to it (black and white for one example) or leave the image as is. For an example of it in usage, you can see on my site jordanriane.com. Each of the thumbnails on my portfolio are using timthumb to generate it. The original size is around 700x400 pixels.

Timthumb generated (w/ black/white filter applied): http://jordanriane.com/scripts/timthumb.php?src=images/screenshots/jexoo.png&w=200&h=175&f=2&zc=1

Original: http://jordanriane.com/images/screenshots/jexoo.png

So I want you to use this in your photos query so we're going to change the image URL around. Here is what it will look like:

&lt;img src="&lt;?php bloginfo('theme_directory');?&gt;/timthumb.php?scr=&lt;?php echo get_post_meta($post-&gt;ID, 'photo_url', true) ?&gt;&amp;w=200&amp;h=175" alt="&lt;?php the_title(); ?&gt;" /&gt;

<?php bloginfo('theme_directory');?>/timthumb.php?scr=

^ That is the URL to call timthumb.php

&w=200&h=175

^ These are defined by timthumb. In my example, we're setting the thumbnail width to 200px and the height to 175 pixels. You can see more on Timthumb's project page. There are other examples of what is capable of the script. :)

Alright so now are query will look like:

 &lt;?php query_posts('cat=4&amp;showposts=-1'); while (have_posts()) : the_post(); ?&gt;
&lt;h2&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark" title="&lt;?php _e('Permalink to: ', 'pyrmont_v2'); ?&gt;&lt;?php the_title_attribute(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;        
&lt;?php if ( get_post_meta($post-&gt;ID, 'photo_url', true) ) : ?&gt;
    &lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;
           &lt;img src="&lt;?php bloginfo('theme_directory');?&gt;/timthumb.php?scr=&lt;?php echo get_post_meta($post-&gt;ID, 'photo_url', true) ?&gt;&amp;w=200&amp;h=175" alt="&lt;?php the_title(); ?&gt;" /&gt;   &lt;/a&gt;
&lt;?php endif; ?&gt;
&lt;?php endwhile; ?&gt;

Whatever else you want your query to display is up to you.

Link to comment
Share on other sites

  • 0

wow, thanks. I'm just about to head off to work but will definitely read through that in more detail when i get home. much appreciated :)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.