magicalwonders
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Including Archives.php problemI’ve just discovered I needed to add this code to the top of my template…
<?php /* Template Name: Archives */ ?>
Thanks to this blog for providing the solution – https://jeff-way.com/2009/05/12/add-an-archives-page-to-your-wordpress-theme/
Forum: Fixing WordPress
In reply to: Including Archives.php problemO.K. I have created the following file called archives.php
<?php get_header(); ?> <div id="mainContent" class="column"> <?php get_search_form(); ?> <h2>Archives by Month:</h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <h2>Archives by Subject:</h2> <ul> <?php wp_list_categories(); ?> </ul> </div> <?php get_footer(); ?>
This file has been uploaded to my themes directory. However, when I go to add new page and click on drop down list under attributes, the only items showing are the pages that have already been created. There are no template files to select.
Am I missing a step here?
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingHi buddha trance,
Thanks for the explanation. Much appreciated.
I’ve had a play around with the code and the following also works on the index page.
<?php if ( is_home() ) { ?> <?php include(TEMPLATEPATH.'/sidebar2.php');?> <?php } else { ?> <?php get_sidebar(); ?> <?php } ?>
I think I’m starting to get the hang of this php with WordPress stuff! lol.
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingHooray, it works! Thanks for the help, I really appreciate it.
It’s a bit confusing though, setting it to “is_home” as it doesn’t actually go to the home page. Is that because the “Home page” has been set as static and therefore doesn’t contain a loop?
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingO.K. I’ve played around with this and discovered that I can get the sidebar2.php showing on any page except the “News” page.
In my Admin settings I have the static page set as – Front page: Home and Posts page: News
So I suppose this is what is causing the problem. However, I need the archive to show on the “News” page, so not sure how to get around this problem.
Any advice would be appreciated.
Many thanks,
Myles
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingThis isn’t working for me for some reason.
I’ve only got six templates currently in the theme. Index.php footer.php header.php sidebar.php sidebar1.php and sidebar2.php
The index now shows
<?php get_sidebar(); ?>
sidebar.php code is –<?php if ( is_page('36') ) { ?> <?php include(TEMPLATEPATH.'/sidebar2.php');?> <?php } else { ?> <?php include(TEMPLATEPATH.'/sidebar1.php');?> <?php } ?>
sidebar1.php code is –
<div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> <!-- end #sidebar --></div>
and sidebar2.php code is –
<div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> </div> <div> <h2>Archives</h2> <?php wp_get_archives('type=monthly'); ?> <!-- end #sidebar2 --></div>
Have no idea why this is not working for me.
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingHi buddha trance,
Thanks for the help. I’ve tried that code, but it still doesn’t seem to display sidebar2.php for some reason. I can’t see where I’m going wrong.
My index.php is as follows:
<?php get_header(); ?> <?php if ( is_page('36') ) { ?> <?php include(TEMPLATEPATH.'/sidebar2.php');?> <?php } else { ?> <?php include(TEMPLATEPATH.'/sidebar.php');?> <?php } ?> <div id="mainContent" class="column"> <?php if (have_posts()): ?><?php while(have_posts()):the_post(); ?> <div class="post" id="post-<?php the_id(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="entry"> <?php the_content(); ?> <p class="postmetadata"> <?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?><br /> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?> </p> </div> </div> <?php endwhile; ?> <div class="navigation"> <?php posts_nav_link('','Previous page','Next page'); ?> </div> <?php else: ?> <div class="post"> <h2><?php_e('not_found'); ?></h2> </div> <?php endif; ?> <!-- end #mainContent --></div> <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" /> <?php get_footer(); ?>
Code for sidebar.php is –
<div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> <!-- end #sidebar --></div>
And sidebar2.php is as follows –
<div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> </div> <div> <h2>Archives</h2> <?php wp_get_archives('type=monthly'); ?> <!-- end #sidebar2 --></div>
When uploaded, only sidebar appears to be showing on the News page –
https://really-valid-info.com/blog/?page_id=36I can’t see why this is not working?
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingI’ve also tried using a conditional statement just in the one sidebar as follows:
<?php if (is_page ('News')) { ;?> <div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> </div> <div> <h2>Archives</h2> <?php wp_get_archives('type=monthly'); ?></div> <?php } else { ?> <div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> <?php } ?> <!-- end #sidebar --></div>
That doesn’t seem to have any affect either!
Anyone got any ideas on why my code isn’t working?
Forum: Fixing WordPress
In reply to: Code for calling Sidebars not workingHi, thanks for the response.
I’ve been playing around with this a bit and have modified my code.
I now have two sidebars called sidebar.php and sidebar2.phpHave tried the following code without success –
<?php get_header(); ?> <?php if (is_page('36')) { include(TEMPLATEPATH . '/sidebar2.php'); } else { get_sidebar(); } ?>
My code for sidebar2 is as follows
<div id="sidebar1" class="column"> <ul id="navlist" class="backgroundbullet"> <?php wp_list_pages('sort_column=menu_order&title_li='); ?> </ul> </div> <div> <h2>Archives</h2> <?php wp_get_archives('type=monthly'); ?> <!-- end #sidebar2 --></div>
I don’t seem to be able to get sidebar2 which shows the archive to display. I’ve tried (is_page(’36’) without the quotes around the number, but that doesn’t seem to work either!
Not sure where I’m going wrong?
Would be grateful for any advice.
Myles
Forum: Fixing WordPress
In reply to: Matching column script not quite workingI’ve got this working now. It turned out to be an issue with padding in my main content div.
Forum: Themes and Templates
In reply to: Custom theme creation template filesHi,
Thanks for the link. Much appreciated.
Myles
Forum: Plugins
In reply to: Problem adding tag for nextgen-gallery pageThanks Alex,
I didn’t realise it actually goes into the text box on the page. In posts there is an area specifically for tags and this was confusing me!
Forum: Fixing WordPress
In reply to: How do you show nav links from pages to posts?I think I’ve sorted it. A couple of style issues have cropped up, but I’m getting there!
Forum: Fixing WordPress
In reply to: How do you show nav links from pages to posts?A quick update… I’ve now managed to get the sidebar showing on the post page – by editing single.php. This displays the Nav links to other pages. But I still have no idea how to include the link for the post page itself!
Any help would be appreciated.
Many thanks.
Myles
Forum: Fixing WordPress
In reply to: Trying to remove date stamp and blog referencesI’ve managed to track down the code in page.php and index.php to remove the unwanted bit. All sorted now! ??