Can it be done similar to widgets like this:
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'col-left',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
register_sidebar(array('name'=>'col-right',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
?>
Is there something similar for page links that I can add the image and span tags in the structure of how the page navigation links are displayed???
you can used wp_list_pages() with echo off;
$options = 'sort_column=menu_order&title_li=&echo=';
$pages_links = wp_list_pages($options);
// do stuff with $pages_links here
echo $pages_links;
example add span ↓
$pages_links = wp_list_pages('sort_column=menu_order&title_li=&echo=');
$pages_links = preg_replace('%<a ([^>]+)>%U','<a $1><span>', $pages_links);
$pages_links = str_replace('</a>','</span></a>', $pages_links);
echo $pages_links;
http://codex.wordpress.org/Template_Tags/wp_list_pages#Parameters
Thanks Chaoskaizer.
Would I add this to the functions.php page or directly in my header.php file where I want the pagelinks to appear?
Are there any other tags I need to add or can I just copy and paste what you added above? Don’t I need <?php> or something else.
Sorry, I am not really an expert on this but I am learning.
Thanks Again.
-Chris
you can wrap it as PHP function
<?php
// functions.php
function my_theme_pages_links(){
$pages_links = wp_list_pages('sort_column=menu_order&title_li=&echo=');
$pages_links = preg_replace('%<a ([^>]+)>%U','<a $1><span>', $pages_links);
$pages_links = str_replace('</a>','</span></a>', $pages_links);
echo $pages_links;
}
?>
and called it inside template
<?php my_theme_pages_links(); ?>
AWESOME! THANK YOU BIG TIME!
-Chris