views:

106

answers:

4

Hi,

Hoping someone can assist but I am currently teaching myself WordPress and working on my own CMS site.

My site will consist of approx 5 pages where the header/sidebar menu/footer will be seen on all these 5 pages.

Newbie here and questions are as follows:

  1. All these 5 pages will consist of different content, for example, every page will have a image banner representing the menu option just clicked, for example, "About Us" on page 5, "Promotions" on page 4 etc and then some text beneath that and then possibly some images inside a carousel set up.

    Within WordPress, how would I tackle this, i.e. do I just create a page in WordPress, position the banner image at the top of the page, then have a few breaks and then insert the carousel of images - is this correct?

    If not, do I need to create a separate php file called aboutUs.php that has this markup and then somehow link it to a WordPress page?

  2. On my landing page of my site ONLY (page 1), just above the footer, I want to display a div section that displays all the sponsors of the website along with a URL to click to their websites - how would I go about doing this in WordPress?

  3. Furthermore, with my menu, how do I link my menus to point to the WordPress pages relating to that menu option?

    If there are any sites that people know that will somehow answer my queries, pls pass them on.

Thanks.

A: 

Look into Wordpress "page templates". The Wordpress codex can help you understand this.

If you edit a post in WP you will notice the option to use a template. That is your goal. Learn how to work with them.

Moshe
+1  A: 

If you use the 'default' template that comes with WordPress you could do something like this to generate different content on different pages without creating separate php files (this would go in page.php):

<?php if(is_page('About Us')) { ?>
<?php $about_query = new WP_Query('category_name=aboutus-&showposts=1');
while ($about_query->have_posts()) : $about_query->the_post(); ?>
 <?php the_content();?>
 <?php endwhile;?>

Essentially, in this you could just create a post and an 'aboutus' category to reference it. The page of 'About Us' (referenced through is_page()) would contain the content you wanted to display.

Ian
A: 
  1. Wordpress themes are composed of multiple files. One of them is the header.php file which contains the header content. The footer.php file contains the footer and the sidebar.php contains the sidebar. These are the usual conventions. They're not strict. There will be a couple of main files which include these (e.g., index.php - Used for articles, page.php - Used to display pages etc.)

    If I were making a setup like yours, I'd make five "pages" (using the backend) and then customise my page.php file to present it properly. I'd still keep the header, footer and sidebar separate from the page.php file since they'd be there for pages like 404s etc. as well.

  2. Just put something in the content of the landing page to display this.

IF you're doing theme development, the right place to look at is http://codex.wordpress.org/Theme_Development

Noufal Ibrahim
A: 

First, some background. Wordpress has a number of ways to display stuff, such as images, text, and query results; here's a list:

THEMES

You can modify your theme files directly to do whatever you like. This will probably involve learning a lot about PHP and the Wordpress internals, but there are plenty of books, and the Wordpress Codex to help you. You can get themes from the Wordpress theme directory.

PLUGINS

There are huge numbers of Wordpress plugins, any one of which might fit your need. Plugins will require configuration, but generally won't involve learning PHP -- just how to install and configure them. Most of the SEO (Search Engine Optimization) plugins will allow you to place custom HTML in the templates (nominally for ad placement, but you can do anything you want with it). You can get plugins from the Wordpress plugin directory.

WIDGETS

The base Wordpress software and many plugins provide Widgets. A widget is a display element that can be docked in one or more widget areas. Typically a widget will be a chunk of HTML (often an unordered list) that has the theme's style sheet applied. Widgets are often used for ad placement, navigation elements (menus, dropdowns, breadcrumbs) or to provide tag clouds, category lists, calendars, etc.

SHORTCODE

A shortcode is a macro that can be placed in a page or post, that will return a chunk of HTML. Shortcodes can take parameters that will affect what the shortcode returns. The base Wordpress software provides some shortcodes, but many plugins will provide shortcodes as a way to get more functionality without the need for widgets or theme modifications.

With all of that in mind, here's my answer(s) to your question(s):

  1. Modify your theme to include a page template, and add your image selection code to the template. Then create your individual pages, and then select your template while editing the page.
  2. The 'landing page' can be any page (instead of the default blog index page); create a 'home' page and a 'home' page template that includes your advertisements. Alternately, use a SEO plugin to add the ads above the footer.
  3. I don't know what theme or plugins you use, but generally you can configure a navigation menu to work from a list of pages, specifying either which pages to include or which pages to exclude. If your theme doesn't include this functionality, I'd recommend choosing a different theme.
Craig Trader