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.
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.
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.