• Hello,

    I am wanting some help with my website.

    I am running a weekly event and want to keep it updated on my website. I have a new page for each week, but on that page i also want a link to every other weeks information.

    What i want to do is have 1 page of links that will show on all the weekly pages.

    What i am doing at the moment is setting it all up manually. The probalem is every update requires me to edit every page and add in the new link, once i get to week 20 its ging to take ages! Is there a short way of doing this?

    my website is http://www.derbywargamessociety.com and the pages i’m talking about are http://derbywargamessociety.com/events/2009-wfb-campaign/weekly-results

    Thanks
    Ben

Viewing 6 replies - 1 through 6 (of 6 total)
  • I am fairly new to wordpress, so I am not sure about the options within wordpress itself.

    But wordpress aside, in a theme you include php files like the header and footer. I bet you could make a php file with these links in it. and include it in the weekly pages.

    Then every time there’s a new weekly page, you just have to create the new page and update the links from the php file.

    Thread Starter BenCurry

    (@bencurry)

    Thats exactly what i need but how would i go about doing it

    well it is similair to the header and footer files.

    simply make a new file called weekly-links.php or something other of your choosing.

    then in the template file for the weekly pages, put an include link just like it’s done with the header and footer on the place where you want the links to be.
    I think wordpress has made functions for the header and footer, like <?php get_header ?> so I doubt it will work like that. but if I recall correctly to include a file you could use this.

    <?php include (TEMPLATEPATH . ‘/weekly-links.php’); ?>

    the TEMPLATEPATH being the main directory for your theme, so if it’s in a sub-category named “weekly” it would be something like

    <?php include (TEMPLATEPATH . ‘/weekly/weekly-links.php’); ?>

    I think that should work, again I am not sure, since I haven’t tried this myself and I am fairly new to wordpress and my php is pretty basic aswel.

    Thread Starter BenCurry

    (@bencurry)

    I’ve had a play around and I can’t seem to get it to work.

    What should i be putting in the weekly-links.php file?

    And assuming my file is saved in my themes directly should the code in my post be just as you typed it?

    Thanks
    Ben

    in the weekly-links.php file should be the links for each week.
    the idea is that this file is included, so when you have a new week, you only have to update the weekly-links.php file. and since it’s already included in the weekly pages it’ll update there aswel.

    and if the file is in your themes directory it should be
    <?php include (TEMPLATEPATH . ‘/weekly-links.php’); ?>

    but once again I haven’t tested these things myself, so it’s more like theory.
    I am currently working on my own website aswel and as I’ve mentioned I’m fairly new to wordpress so it’s taking up some time. but if I have some free time I will try this out myself.

    Thread Starter BenCurry

    (@bencurry)

    It doesn’t seem to work.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Page template help’ is closed to new replies.