<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Tag: categories-widget</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Sat, 25 May 2013 16:57:14 +0000</pubDate>

<item>
<title>helgatheviking on "Separators for categories-widget (php solution needed! css not working)"</title>
<link>http://themeshaper.com/forums/topic/separators-for-categories-widget-php-solution-wanted-css-not-working#post-16958</link>
<pubDate>Sat, 13 Nov 2010 05:08:38 +0000</pubDate>
<dc:creator>helgatheviking</dc:creator>
<guid isPermaLink="false">16958@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;after digging around in the wordpress files, the default categories widget is generated by&#60;/p&#62;
&#60;p&#62;class WP_Widget_Categories extends WP_Widget&#60;/p&#62;
&#60;p&#62;in the default-widgets.php file in wp-includes&#60;/p&#62;
&#60;p&#62;however, arent the categories generated in a ul list.  can't you use the list-style css attribute and apply a bullet?  you could also apply a border?  or a background image?  why isnt a CSS solution satisfactory?
&#60;/p&#62;</description>
</item>
<item>
<title>mo on "Separators for categories-widget (php solution needed! css not working)"</title>
<link>http://themeshaper.com/forums/topic/separators-for-categories-widget-php-solution-wanted-css-not-working#post-16952</link>
<pubDate>Fri, 12 Nov 2010 20:39:45 +0000</pubDate>
<dc:creator>mo</dc:creator>
<guid isPermaLink="false">16952@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;what a pity,… just a tip in the right direction would help,&#60;br /&#62;
please!
&#60;/p&#62;</description>
</item>
<item>
<title>mo on "Separators for categories-widget (php solution needed! css not working)"</title>
<link>http://themeshaper.com/forums/topic/separators-for-categories-widget-php-solution-wanted-css-not-working#post-16420</link>
<pubDate>Tue, 19 Oct 2010 13:02:15 +0000</pubDate>
<dc:creator>mo</dc:creator>
<guid isPermaLink="false">16420@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;&#60;strong&#62;No Idea anyone?&#60;/strong&#62;&#60;br /&#62;
I just kept searching but cannot find the PHP-code that adresses the wp-categories-widget…&#60;br /&#62;
Sorry for pushing my thread - I'm in need for a solution!
&#60;/p&#62;</description>
</item>
<item>
<title>mo on "Separators for categories-widget (php solution needed! css not working)"</title>
<link>http://themeshaper.com/forums/topic/separators-for-categories-widget-php-solution-wanted-css-not-working#post-16400</link>
<pubDate>Mon, 18 Oct 2010 06:17:38 +0000</pubDate>
<dc:creator>mo</dc:creator>
<guid isPermaLink="false">16400@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;Hi Forum!&#60;/p&#62;
&#60;p&#62;I wanted to show my cats and tags als block-text in the (header)sidebar of my new website. I used widgets to configure that menu. But when you show a list as block-text you need separators to make the visitor able to differentiate between the tags or cats to choose…&#60;/p&#62;
&#60;p&#62;Well – after some research I found out, that there already are some lines of code, that wordpress is using to define how the tags widget is working and looking. (see code below)&#60;br /&#62;
So I added it to my functions.php and altered it a bit.&#60;br /&#62;
This works fine now… every tag is separated by a &#34;&#124;&#34; from the next tag.&#60;/p&#62;
&#60;p&#62;For the categories-widget I wasn't able to find out how this works in php or if there already is some code I could use to build in a separator. So I thought about it a while and then used some CSS(3?) code which worked (In opposition to the tags-widget the categories-widget is using &#34;&#60;code&#62;li&#60;/code&#62;&#34; classes to define every item),…&#60;br /&#62;
&#60;strong&#62;BUT!&#60;/strong&#62; it only works fine in Firefox &#60;strong&#62;not&#60;/strong&#62; in Safari…&#60;br /&#62;
I'd appreciate if anyone knows a php solution for my problem, because Safari ignores the &#34;&#60;code&#62;li:last-of-type:after&#60;/code&#62;&#34; and shows a &#34;&#124;&#34; after the last cat which doesn't really look fine…&#60;/p&#62;
&#60;p&#62;Well, Here we go for the code,&#60;br /&#62;
&#60;strong&#62;PHP for the tags-widget-separators:&#60;/strong&#62;&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;// configure Tag-Cloud
function my_tag_cloud($defaults) {
$args = array(
&#38;#39;smallest&#38;#39; =&#38;gt; 7, &#38;#39;largest&#38;#39; =&#38;gt; 7, &#38;#39;unit&#38;#39; =&#38;gt; &#38;#39;pt&#38;#39;, &#38;#39;number&#38;#39; =&#38;gt; 25,
&#38;#39;format&#38;#39; =&#38;gt; &#38;#39;flat&#38;#39;, &#38;#39;separator&#38;#39; =&#38;gt; &#38;quot; &#124; &#38;quot;, &#38;#39;orderby&#38;#39; =&#38;gt; &#38;#39;name&#38;#39;, &#38;#39;order&#38;#39; =&#38;gt; &#38;#39;ASC&#38;#39;,
&#38;#39;exclude&#38;#39; =&#38;gt; &#38;#39;&#38;#39;, &#38;#39;include&#38;#39; =&#38;gt; &#38;#39;&#38;#39;, &#38;#39;link&#38;#39; =&#38;gt; &#38;#39;view&#38;#39;, &#38;#39;taxonomy&#38;#39; =&#38;gt; &#38;#39;post_tag&#38;#39;, &#38;#39;echo&#38;#39; =&#38;gt; true
);
$args = wp_parse_args( $args, $defaults );
$tags = get_terms( $args[&#38;#39;taxonomy&#38;#39;], array_merge( $args, array( &#38;#39;orderby&#38;#39; =&#38;gt; &#38;#39;count&#38;#39;, &#38;#39;order&#38;#39; =&#38;gt; &#38;#39;DESC&#38;#39; ) ) ); // Always query top tags

if ( empty( $tags ) )
return;

foreach ( $tags as $key =&#38;gt; $tag ) {
if ( &#38;#39;edit&#38;#39; == $args[&#38;#39;link&#38;#39;] )
$link = get_edit_tag_link( $tag-&#38;gt;term_id, $args[&#38;#39;taxonomy&#38;#39;] );
else
$link = get_term_link( intval($tag-&#38;gt;term_id), $args[&#38;#39;taxonomy&#38;#39;] );
if ( is_wp_error( $link ) )
return false;

$tags[ $key ]-&#38;gt;link = $link;
$tags[ $key ]-&#38;gt;id = $tag-&#38;gt;term_id;
}

$return = wp_generate_tag_cloud( $tags, $args ); // Here&#38;#39;s where those top tags get sorted according to $args

$return = apply_filters( &#38;#39;my_tag_cloud&#38;#39;, $return, $args );

if ( &#38;#39;array&#38;#39; == $args[&#38;#39;format&#38;#39;] &#124;&#124; empty($args[&#38;#39;echo&#38;#39;]) )
return $return;

echo $return;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;strong&#62;CSS(3?) for the cats-widget-separator:&#60;/strong&#62;&#60;br /&#62;
the &#34;&#60;code&#62;li:last-of-type:after&#60;/code&#62;&#34; gets ignored by Safari,…&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;.widget_categories li{
display: inline;
font-style: normal;
font-weight:normal;
font-size:10px;
line-height:15px;
text-transform:none;
}

.widget_categories li:after{
content: &#38;quot; &#124; &#38;quot;;
}

.widget_categories li:last-of-type:after{
content: none;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thank you in advance!
&#60;/p&#62;</description>
</item>

</channel>
</rss>
