Posts Tagged ‘sub’
Holy Keyword Loaded Sub-domains Batman!
Written by Chris on August 20, 2008 – 5:08 pm -After finding this in a random search on Google for CSV to SQL converters a couple of days ago and dismissing it, I have just done some other queries for MySQL scripts and seen results like this:
What the hell is going on? Surely these don't give better SEO do they Google....?
They certainly don't help my search!
Popularity: 45% [?]
Sphere: Related ContentTags: domains, Google, keyword, loaded, MySQL, Search, SEO, sub, subdomains
Posted in SEO | No Comments »
Page and Sub-page Menus In Wordpress
Written by Chris on September 17, 2007 – 6:52 pm -Recently I wanted to change the theme I use on my personal blog to the following: http://www.wpdesigner.com/2007/01/22/digg-3-columns-wordpress-theme/ as the current one I was using was pretty awful (to say the least) and this was a lot better
I liked this theme but unfortunately it lacked one thing (as do a lot of other themes I've used) - an auto generating set of page menu tabs at the top. The default theme just had a link to the home and about pages, so I added this in and it now works exactly the way I wanted it to. I've pasted the code below should you wish to do something similar.
This mod basically creates a list of all the parent pages along the top (which are rendered as tabs due to the css), and then when a link of a parent page is clicked, it displays the home tab, the tab for the parent page and then the list of tabs for the sub pages of that parent page.
On my site so far I only have one level of sub pages below the parent, but I believe this should work for any hierarchy of sub-sub pages - if you use this code and it does please post a comment to let me know.
Also this is a bit rough - the next time I use it I will probably clean it up a bit, but I know it works for now. If you'd like to provide me with a cleaner version before I have chance to work on it please feel free to drop me a line, and if it works I'll also post it here.
-
-
<div id="header">
-
-
<div id="menu">
-
<ul>
-
<li><a href="<?php bloginfo('url'); ?>/" title="<?php bloginfo('name'); ?>"><?php _e('Home'); ?></a></li>
-
-
-
<?php
-
-
// From http://codex.wordpress.org/Template_Tags/wp_list_pages
-
-
'show_date' => '',
-
'date_format' => get_option('date_format'),
-
'child_of' => 0,
-
'exclude' => '2, 53',
-
'title_li' => '',
-
'echo' => 1,
-
'authors' => '',
-
'sort_column' => 'menu_order, post_title');
-
-
if($post->post_parent)
-
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
-
else
-
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
-
-
if ($children)
-
{
-
{
-
wp_list_pages('title_li=&include='.$post->post_parent);
-
}
-
else
-
{
-
?>
-
<li><a href="<?php echo get_permalink($post->ID); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
-
<?php
-
-
-
-
}
-
echo $children;
-
}
-
else
-
{
-
?>
-
<li><a href="<?php echo get_permalink(2); ?>" title="<?php _e('About'); ?>"><?php _e('About'); ?></a></li>
-
<?php
-
wp_list_pages($defaults);
-
}
-
?>
-
-
</ul>
-
</div>
-
Popularity: 18% [?]
Sphere: Related ContentTags: menu, page, sub, sub-page, subpage, theme, Wordpress
Posted in PHP, Wordpress | 2 Comments »















Feed 
