<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP Engineer &#187; Add new tag</title>
	<atom:link href="http://wpengineer.com/tag/add-new-tag/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Mon, 21 May 2012 22:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>List All Users in WordPress</title>
		<link>http://wpengineer.com/365/list-all-users-in-wordpress/</link>
		<comments>http://wpengineer.com/365/list-all-users-in-wordpress/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 13:15:25 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=365</guid>
		<description><![CDATA[The possibility in WordPress to display all users is not available in a standard installation. To get a simple list of all users, you can use following function. To display just specific user groups or users, there are many template tags available to do so, go to WordPress-Codex - Author Tags. it's a simple, not [...]]]></description>
			<content:encoded><![CDATA[<p>The possibility in WordPress to display all users is not available in a standard installation. To get a simple list of all users, you can use following function. To display just specific user groups or users, there are many template tags available to do so, go to <a href="http://codex.wordpress.org/Template_Tags#Author_tags">WordPress-Codex - Author Tags</a>.<br />
<span id="more-365"></span></p>
<p>it's a simple, not optimized database query. It should be just a basic example and can or must be extend furthermore. Notice, &bdquo;Registered Readers&rdquo; are not saved via <code>user_level</code> in the database. This made it necessary to have a separate database query.</p>
<p>You have the possibility to give the function two parameters. To display only one user group you can use the parameter <code>$userlevel</code>. If you need to display first name and last name, then the parameter <code>$show_fullname</code> has to set to <code>TRUE</code>, otherwise it will display the user name only.</p>
<p>To use the function, you have to put it in your <code>functions.php</code> of your theme. You can call the function with the help of the PHP Plugin (z.B. <a href="http://www.soeren-weber.net/post/2005/08/18/50/">Exec-PHP</a>) or in your template.</p>
<h5>Only administrator, only user name</h5>
<pre lang="php">
&lt;ul&gt;
&lt;?php fb_list_authors(10, FALSE); ?&gt;
&lt;/ul&gt;
</pre>
<h5>All user, first and last name</h5>
<pre lang="php">
&lt;ol&gt;
&lt;?php fb_list_authors(); ?&gt;
&lt;/ol&gt;
</pre>
<h5>Only reader, first and last name</h5>
<pre lang="php">
&lt;ul&gt;
&lt;?php fb_list_authors(1, TRUE); ?&gt;
&lt;/ul&gt;
</pre>
<p>The function for <code>functions.php</code> or directly in your template.</p>
<pre lang="php">
function fb_list_authors($userlevel = &#039;all&#039;, $show_fullname = true) {
	global $wpdb;

/*
 all = Display all user
 1 = subscriber
 2 = editor
 3 = author
 7 = publisher
10 = administrator
*/

if ( $userlevel == &#039;all&#039; ) {
	$author_subscriper = $wpdb-&gt;get_results(&quot;SELECT * from $wpdb-&gt;usermeta WHERE meta_key = &#039;wp_capabilities&#039; AND meta_value = &#039;a:1:{s:10:\&quot;subscriber\&quot;;b:1;}&#039;&quot;);
	foreach ( (array) $author_subscriper as $author ) {
		$author    = get_userdata( $author-&gt;user_id );
		$userlevel = $author-&gt;wp2_user_level;
		$name      = $author-&gt;nickname;
		if ( $show_fullname &amp;&amp; ($author-&gt;first_name != &#039;&#039; &amp;&amp; $author-&gt;last_name != &#039;&#039;) ) {
			$name = &quot;$author-&gt;first_name $author-&gt;last_name&quot;;
		}
		$link = &#039;&lt;li&gt;&#039; . $name . &#039;&lt;/li&gt;&#039;;
		echo $link;
	}

	$i = 0;
	while ( $i &lt;= 10 ) {
		$userlevel = $i;
		$authors = $wpdb-&gt;get_results(&quot;SELECT * from $wpdb-&gt;usermeta WHERE meta_key = &#039;wp_user_level&#039; AND meta_value = &#039;$userlevel&#039;&quot;);
		foreach ( (array) $authors as $author ) {
			$author    = get_userdata( $author-&gt;user_id );
			$userlevel = $author-&gt;wp2_user_level;
			$name      = $author-&gt;nickname;
			if ( $show_fullname &amp;&amp; ($author-&gt;first_name != &#039;&#039; &amp;&amp; $author-&gt;last_name != &#039;&#039;) ) {
				$name = &quot;$author-&gt;first_name $author-&gt;last_name&quot;;
			}
			$link = &#039;&lt;li&gt;&#039; . $name . &#039;&lt;/li&gt;&#039;;
			echo $link;
		}
		$i++;
	}
} else {
	if ($userlevel == 1) {
		$authors = $wpdb-&gt;get_results(&quot;SELECT * from $wpdb-&gt;usermeta WHERE meta_key = &#039;wp_capabilities&#039; AND meta_value = &#039;a:1:{s:10:\&quot;subscriber\&quot;;b:1;}&#039;&quot;);
	} else {
		$authors = $wpdb-&gt;get_results(&quot;SELECT * from $wpdb-&gt;usermeta WHERE meta_value = &#039;$userlevel&#039;&quot;);
	}
	foreach ( (array) $authors as $author ) {
		$author = get_userdata( $author-&gt;user_id );
		$userlevel = $author-&gt;wp2_user_level;
		$name = $author-&gt;nickname;
		if ( $show_fullname &amp;&amp; ($author-&gt;first_name != &#039;&#039; &amp;&amp; $author-&gt;last_name != &#039;&#039;) ) {
			$name = &quot;$author-&gt;first_name $author-&gt;last_name&quot;;
		}
		$link  = &#039;&lt;li&gt;&lt;b&gt;&#039; . $userlevelname&#091;$userlevel&#093; . &#039;&lt;/b&gt;&lt;/li&gt;&#039;;
		$link .= &#039;&lt;li&gt;&#039; . $name . &#039;&lt;/li&gt;&#039;;
		echo $link;
	}
}
}
</pre>
<p>Alternatively you can use a very small syntax. You must customize the fields of the query.</p>
<pre lang="php">
&lt;?php
$wp_user_search = $wpdb-&gt;get_results(&quot;SELECT ID, display_name FROM $wpdb-&gt;users ORDER BY ID&quot;);

foreach ( $wp_user_search as $userid ) {
	$user_id       = (int) $userid-&gt;ID;
	$user_login    = stripslashes($userid-&gt;user_login);
	$display_name  = stripslashes($userid-&gt;display_name);

	$return  = &#039;&#039;;
	$return .= &quot;\t&quot; . &#039;&lt;li&gt;&#039;. $display_name .&#039;&lt;/li&gt;&#039; . &quot;\n&quot;;

	print($return);
}
?&gt;
</pre>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/365/list-all-users-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Easy Breadcrumb Navi With WordPress</title>
		<link>http://wpengineer.com/10/easy-breadcrumb-navi-with-wordpress/</link>
		<comments>http://wpengineer.com/10/easy-breadcrumb-navi-with-wordpress/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 09:12:10 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[breadcrumb]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=10</guid>
		<description><![CDATA[In a small series of tips and hacks of creating a theme, I will show you how to add a breadcrumb navi in your theme. This kind of navi has established in many websites and is an added value to a user friendly navigation.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-15" title="Breadcrumb Navigationen" src="http://wpengineer.com/wp-content/uploads/breadcrumb.jpg" alt="Example Breadcrumb Navigationen" width="300" height="200" /><br />
WordPress Themes are very flexible, you can easily make use of PHP. The <code>functions.php</code> of a Theme can easily be modified to add several functions to it.</p>
<p>In a small series of tips and hacks of creating a theme, I will show you how to add a breadcrumb navi in your theme. This kind of navi has established in many websites and is an added value to a user friendly navigation.<br />
<span id="more-10"></span><br />
Just FYI; every body who doesn&#8217;t like to mess around in functions, there are also some <a href="http://wordpress.org/extend/plugins/search.php?q=breadcrumb">Plugins</a> available.</p>
<h3>This is how it work&#8217;s</h3>
<p>The solution without a Plugin, directly in your theme. You have to copy the following function in functions.php; so it will be available in your theme and can be used everywhere. The function will be called in your <code>header.php</code> for example and via CSS formated. I used the class <code>breadcrumb</code> . An example of my dev blog is showing in the picture above.</p>
<pre lang="php">
// breadcrump Navigation
if (!function_exists(&#039;fb_breadcrumb_nav&#039;)) {
	function fb_breadcrumb_nav() {
		if ( !is_home() || !is_front_page() ) {
			_e(&#039;&lt;p class=&quot;breadcrumb&quot;&gt;&raquo; &lt;a href=&quot;&#039;) . _e( get_option(&#039;home&#039;) ) . _e(&#039;&quot;&gt;&#039;) . bloginfo(&#039;name&#039;) . _e(&#039;&lt;/a&gt; &raquo; &#039;);
			if ( is_category() ) {
				single_cat_title();
				//the_category(&#039;, &#039;);
			} elseif ( is_single() ) {
					the_category(&#039;, &#039;) . _e(&#039; &raquo; &#039;) . the_title();
			} elseif ( is_page() ) {
				_e( the_title() . &#039;&lt;/p&gt;&#039;);
			} elseif (is_page() &amp;&amp; $post-&gt;post_parent ) {
				_e( get_the_title($post-&gt;post_parent) );
				_e(&#039; &raquo; &#039;);
				_e( the_title() );
			} elseif ( is_search() ) {
				_e(&#039;Suche nach: &#039;) . the_search_query() . _e(&#039;&lt;/p&gt;&#039;);
			}
		}
	}
}
</pre>
<p>You can change this function above as you like of course. It is just a simple example and just explain the idea and the function. You can also adjust the structure and output by the help of Conditional Tags. This function is without any modification usable and shouldn&#8217;t provide any big problems to implement.</p>
<p>The mix of HTML and PHP can be confusing for some readers, but it was important for me to show the structured outline of this function. That&#8217;s why I implement HTML in my example. Of course you can use „echos“ to deliver variables.</p>
<h3>In one&#8217;s own Account</h3>
<p>I wish you fun with experimenting and using this solution; Feedback is also welcome.<br />
But before you have a question, please try to understand the code first. I&#8217;m swamped in support emails and can barely answer all of them due to lack of time. I prefer to use my little free time to write about ideas, solutions on this blog. I appreciate your understanding.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/10/easy-breadcrumb-navi-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

