Is there a way to use a special character in this:
<?php wp_list_pages('title_li=&link_after=→'); ?>
the goal is link name with an arrow as part of the link.
I don't know php, and have tried copying various things but nothing shows:
<?php wp_list_pages('title_li=&link_after="→"'); ?>
<?php wp_list_pages("title_li=&link_after='→'"); ?>
<?php wp_list_pages('title_li=&link_after=' . __('→') . ' '); ?>
Is there a way to escape or something so a special character using an ampersand will work in the php line?
ckpicker
Member
Posted 3 years ago #
Any ideas on this one? I'm running into this issue also.
ThemeBlender
Member
Posted 3 years ago #
You need to pass your options as an array through a variable to the function:
<?php
$arguments = array('title_li' => '» My Title', 'link_after' => '→');
wp_list_pages($arguments);
?>
Hope that helps.
----------
Aaron
ThemeBlender
Any idea how to get the same functionality out of wp_list_categories? for some reason, that doesn't seem to have been brought in with 2.7.
gregg
leewilson78
Member
Posted 2 years ago #
I too am trying to add something similar with category links.
Any workaround?
vasilescu_anton
Member
Posted 2 years ago #
I have the same issue here. Is there any way to add special character as » as a prefix to the list of categories generated by wp_list_categories?
I would really appreciate any guidance on how to achieve this!
Thanks!
JoshKay
Member
Posted 2 years ago #
@vasilescu_anton the easiest way is probably through CSS. Just identify the container (probably something like '#sidebar ul li' in your theme's 'style.css') and change the li:before and put in the hex code for the character you want.
Try adding
#sidebar ul ul li:before {
content: "0BB 020";
}
JoshKay
Member
Posted 2 years ago #
And I have another question...
I am using link_after in wp_list_pages and trying to incorporate the meta data from each page. In this case it's part of a url to an image in order to reconstruct an img tag.
So
<?php
wp_list_pages('title_li=&child_of=3&link_after=<img src="' .
bloginfo('siteurl') .
get_post_custom_values('the_key', $id) . '.jpg'); ?>
Obviously this is wrong, but how do I retrieve that data during the wp_list_pages function?