<?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>WebGurus</title>
	<atom:link href="http://www.webgurus.biz/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webgurus.biz</link>
	<description>Pixel perfect Web design and Web Development in Cluj-Napoca, Romania.</description>
	<lastBuildDate>Mon, 07 May 2012 11:56:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>A step-by-step guide on the logo design process</title>
		<link>http://www.webgurus.biz/blog/a-step-by-step-guide-on-the-logo-design-process/</link>
		<comments>http://www.webgurus.biz/blog/a-step-by-step-guide-on-the-logo-design-process/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 13:33:45 +0000</pubDate>
		<dc:creator>Guru</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[logo]]></category>

		<guid isPermaLink="false">http://www.webgurus.biz/?p=299</guid>
		<description><![CDATA[We&#8217;ve just published a new article on our Design Blog about the process of logo design in ...]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just published a new article on our <a href="http://www.webgurusdesignblog.com/2011/12/a-step-by-step-guide-on-the-logo-design-process/">Design Blog</a> about the process of logo design in a step-by-step guide.</p>
<p>A logo gives the power of creating a visual communication between the visitor and a company, which serves as an extension to the company’s business. A logo should be designed in such a way that it serves the company’s identity on Websites, brochures, fax forms, social media, and almost everywhere. Speaking in a more structured [...]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webgurus.biz/blog/a-step-by-step-guide-on-the-logo-design-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to limit WordPress gallery thumbnails in the loop</title>
		<link>http://www.webgurus.biz/wordpress/how-to-limit-wordpress-gallery-thumbnails-in-the-loop/</link>
		<comments>http://www.webgurus.biz/wordpress/how-to-limit-wordpress-gallery-thumbnails-in-the-loop/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 23:09:38 +0000</pubDate>
		<dc:creator>Guru</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.webgurus.biz/?p=286</guid>
		<description><![CDATA[Today I stumbled upon a problem, which I think it should be common sense to have in ...]]></description>
			<content:encoded><![CDATA[<p>Today I stumbled upon a problem, which I think it should be common sense to have in WordPress. I wanted to list the default WordPress image galleries from posts in the loop, but I couldn&#8217;t find any shortcode to limit the displayed number of thumbnails. After spending 2 hours on research I&#8217;ve found some solutions to this problem, but I had to dig in to the functions.php of my theme.</p>
<p>The solution is to modify the GALLERY shortcode with filters from your functions.php file and then define in a variable how many thumbnails you want in the loop, which will be interpreted by a function.<br />
<span id="more-286"></span></p>
<p>Here&#8217;s the function you need to create in the functions.php of your theme file:</p>
<pre name="code" class="php">function get_random_gallery_images(){
	global $wpdb,$post;
		$ids = "";
		$counter = 0;
		$number_of_posts = 4;
		$args = array(
		'post_type' =&gt; 'attachment',
		'numberposts' =&gt; 4,
		'post_status' =&gt; null,
		'orderby' =&gt; 'rand',
		'post_parent' =&gt; $post-&gt;ID
		);
		$attachments = get_posts($args);
		if ($attachments) {
			foreach ($attachments as $attachment) {

				if ($counter != 0) {
					$ids .= ','.$attachment-&gt;ID;
				}
				else {
					$ids .= $attachment-&gt;ID;
				}
				$counter++;
			}
		}
		return $ids;
}</pre>
<p>&nbsp;</p>
<p>And now we can use the following code in our loop:</p>
<pre name="code" class="php">$attachment_ids = get_random_gallery_images();
echo do_shortcode('[ gallery columns="4" include="'.$attachment_ids.'" link="file" ]');</pre>
<p>The result is a loop with posts containing galleries and displaying 4 images from the gallery.</p>
<p><em>Note: The above code has some extra whitespace between the [], because WordPress interprets the code and it won&#8217;t show.</em></p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webgurus.biz/wordpress/how-to-limit-wordpress-gallery-thumbnails-in-the-loop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress Admin Dashboard Hacks &#8211; Removing stuff</title>
		<link>http://www.webgurus.biz/wordpress/wordpress-admin-dashboard-hacks-removing-stuff/</link>
		<comments>http://www.webgurus.biz/wordpress/wordpress-admin-dashboard-hacks-removing-stuff/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 13:13:06 +0000</pubDate>
		<dc:creator>Guru</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.webgurus.biz/?p=203</guid>
		<description><![CDATA[We were developing a custom subscription management plugin for Kamikaze (a cool magazine in Romania) where the ...]]></description>
			<content:encoded><![CDATA[<p>We were developing a custom subscription management plugin for Kamikaze (a cool magazine in Romania) where the subscribed users had to be redirected to the WordPress Dashboard after logging in.</p>
<p>WordPress by default has some small &#8220;widgets&#8221; that are intended for a tech savvy blogger or for an administrator, not for a basic internet user who barely knows how to check his e-mail. This is why we had to remove these so called widgets from the dashboard, but only for the users and not for the administrators.<br />
<span id="more-203"></span><br />
Below is a list of these widgets and a quick solution to remove them if they are not needed:</p>
<h3>1. Screen options (right top)</h3>
<p>This is not a usual removal, but we didn&#8217;t want the users to play with this so we removed it.</p>
<p>First open your theme&#8217;s functions.php file, where you can put this custom code for tweaking the administration dashboard.</p>
<p>Now we create a function which will be attached to the dashboard using wordpress built in action hooks.</p>
<pre name="code" class="php">function remove_screenoptions() {
echo '&lt;style type="text/css"&gt;#screen-meta-links { display: none; } &lt;/style&gt;';
}</pre>
<p>There&#8217;s no custom function or reference to this widget so we had to remove it by using CSS, therefor hiding the actual div which can trigger the slide-down screen options menu.</p>
<p>Second, we add an action hook to the wordpress admin so it will trigger the function when we log in to the wordpress dashboard</p>
<pre name="code" class="php">add_action('admin_head', 'remove_screenoptions');</pre>
<p>Now we should restrict the action hook to the users only, so we wrap the action code with an if statement:</p>
<pre name="code" class="php">
if ( !current_user_can( 'edit_users' ) ) {
add_action('admin_head', 'remove_screenoptions');
}
</pre>
<p>This can be also applied to any element in the WordPress admin, by hiding the container div of that element.</p>
<h3>2. Removing update notifications for users</h3>
<p>This one is a nice improvement for the users if they have to log in to the wordpress dashboard. They don&#8217;t need to be bothered with updates and such, so we remove it with another function in the functions.php file of your theme:</p>
<pre name="code" class="php">
function no_update_notification() {
remove_action('admin_notices', 'update_nag', 3);
}</pre>
<p>after we&#8217;ve created the function we have to hook it with an action to the wordpress admin, but as we did above we wrap an if statement around it which filters this rule only to users and not administrators:</p>
<pre name="code" class="php">
if (!current_user_can('edit_users')) {
add_action('admin_notices', 'no_update_notification', 1);
}</pre>
<p>&nbsp;</p>
<h3>3. Removing dashboard widgets</h3>
<p>Sometimes we need to remove default dashboard widgets, so the users won&#8217;t have access to insights or statistics an administrator should have on it&#8217;s dashboard.</p>
<p>For example, we remove the Right Now dashboard widget by creating the following function in the functions.php file our theme:</p>
<pre name="code" class="php">
function example_remove_dashboard_widgets() {
	// Globalize the metaboxes array, this holds all the widgets for wp-admin
 	global $wp_meta_boxes;

	// Remove right now
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
}</pre>
<p>We hook the function to the WP Dashboard Setup action, and filter it so it executes only for the users:</p>
<pre name="code" class="php">
if (!current_user_can('edit_users')) {
// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );
}</pre>
<p>You can remove as many widgets as you want from the dashboard, by repeating the &#8220;unset()&#8221; function and changing the last value to the ID of the widget.</p>
<p>You can find the ID of a widget by inspecting the element (widget&#8217;s div) with Firebug or Google Chrome&#8217;s inspector.</p>
<h3>4. Removing Menu items</h3>
<p>When you have a user management setup in WordPress, you need to have control over what menu items the users have access to, even if their user level gives them permission to use these items.</p>
<p>Let&#8217;s say you&#8217;ve create a custom profile for the users and you don&#8217;t want them to see or use the default WordPress &#8220;Profile&#8221; menu in their dashboard. There are two ways to accomplish this in your theme&#8217;s function.php file.</p>
<p>a. Custom function</p>
<pre name="code" class="php">
function remove_menus () {
global $menu;
                // We define which menu/submenu items we want to restrict
		$restricted = array(__('Users'),__('Profile'));
		end ($menu);
		while (prev($menu)){
			$value = explode(' ',$menu[key($menu)][0]);
			if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
		}
}
if ( !current_user_can( 'edit_users' ) ) {
add_action('admin_menu', 'remove_menus');
}
</pre>
<p>In the &#8220;$restricted&#8221; variable we can define in an array the menus/submenus we want to restrict, you can use multiple values in the array.</p>
<p>b. Using the WordPress Functions</p>
<p>We set the priority to 999 for the action to run at the end of all other actions.</p>
<pre name="code" class="php">
add_action( 'admin_menu', 'devpress_remove_menus', 999 );
function devpress_remove_menus() {
	remove_submenu_page( 'themes.php', 'theme-editor.php' );
}
</pre>
<p>In this approach you have to define the filename where the menu link points to. You can find these filenames in the &#8220;wp-admin/menu-slug.php&#8221; file on your WordPress installation.</p>
<p>Hopefully these tweaks will help you set up and control your WordPress Dashboard exactly as you want it.</p>
<p>If you know any other useful hacks or modifications don&#8217;t hesitate to post a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webgurus.biz/wordpress/wordpress-admin-dashboard-hacks-removing-stuff/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

