32 Extremely Useful Tricks for the WordPress Functions File

All WordPress themes come with a powerful functions.php file. This file acts as a plugin and allows you to do lots of cool things on your WordPress site. In this article, we will show you some of the most useful tricks for your WordPress functions… Read More »

The post 32 Extremely Useful Tricks for the WordPress Functions File appeared first on WPBeginner.

All WordPress themes come with a powerful functions.php file. This file acts as a plugin and allows you to do lots of cool things on your WordPress site. In this article, we will show you some of the most useful tricks for your WordPress functions file.

Most useful tricks for WordPress functions file

What is Functions File in WordPress?

Functions file commonly known as functions.php file is a WordPress theme file. It comes with all free and premium WordPress themes.

The purpose of this file is to allow theme developers to define theme features and functions. This file acts just like a WordPress plugin and can be used to add your own custom code snippets in WordPress.

You would find many of these code snippets on websites like WPBeginner with instructions telling you to add this code in your theme’s functions.php file or a site-specific WordPress plugin.

Now you may be thinking what’s the difference between a site-specific WordPress plugin and functions.php file? Which one is better?

While functions.php file is more convenient, a site-specific plugin is much better. Simply because it is independent of your WordPress theme and would work regardless of which theme you are using.

On the other hand, a theme’s functions file will only work for that theme and if you switch the theme, then you will have to copy / paste your custom codes into the new theme.

Having said that, here are some extremely useful tricks for the WordPress functions file.

1. Remove WordPress Version Number

You should always use the latest version of WordPress. However, you may still want to remove the WordPress version number from your site. Simply add this code snippet to your functions file.

function wpb_remove_version() {
return '';
}
add_filter('the_generator', 'wpb_remove_version');

For detailed instructions, see our guide on the right way to remove WordPress version number.

Want to white label your WordPress admin area? Adding a custom dashboard logo is the first step in the process.

First you’ll need to upload your custom logo to your theme’s images folder as custom-logo.png. Make sure your custom logo is 16×16 pixels in size.

After that you can add this code to your theme’s functions file.

function wpb_custom_logo() {
echo '
<style type="text/css">
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
background-image: url(' . get_bloginfo('stylesheet_directory') . '/images/custom-logo.png) !important;
background-position: 0 0;
color:rgba(0, 0, 0, 0);
}
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
background-position: 0 0;
}
</style>
';
}
//hook into the administrative header output
add_action('wp_before_admin_bar_render', 'wpb_custom_logo');

For alternate methods and more details see our guide on how to add a custom dashboard logo in WordPress.

3. Change the Footer in WordPress Admin Panel

The footer in WordPress admin area shows the message ‘Thank you for creating with WordPress’. You can change it to anything you want by adding this code.

function remove_footer_admin () {

echo 'Fueled by <a href="http://www.wordpress.org" target="_blank">WordPress</a> | WordPress Tutorials: <a href="http://www.wpbeginner.com" target="_blank">WPBeginner</a></p>';

}

add_filter('admin_footer_text', 'remove_footer_admin');

Feel free to change the text and links that you want to add. Here is how it looks on our test site.

Custom footer in WordPress admin area

4. Add Custom Dashboard Widgets in WordPress

You probably have seen widgets that numerous plugins and themes add in the WordPress dashboard. As a theme developer, you can add one yourself by pasting the following code:

add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');

function my_custom_dashboard_widgets() {
global $wp_meta_boxes;

wp_add_dashboard_widget('custom_help_widget', 'Theme Support', 'custom_dashboard_help');
}

function custom_dashboard_help() {
echo '<p>Welcome to Custom Blog Theme! Need help? Contact the developer <a href="mailto:[email protected]">here</a>. For WordPress Tutorials visit: <a href="http://www.wpbeginner.com" target="_blank">WPBeginner</a></p>';
}

This is how it would look like:

Custom dashboard widget in WordPress

For details, see our tutorial on how to add custom dashboard widgets in WordPress.

5. Change the Default Gravatar in WordPress

Have you seen the default mystery man avatar on blogs? You can easily replace it with your own branded custom avatars. Simply upload the image you want to use as default avatar and then add this code to your functions file.

add_filter( 'avatar_defaults', 'wpb_new_gravatar' );
function wpb_new_gravatar ($avatar_defaults) {
$myavatar = 'http://example.com/wp-content/uploads/2017/01/wpb-default-gravatar.png';
$avatar_defaults[$myavatar] = "Default Gravatar";
return $avatar_defaults;
}

Now you can head over to Settings » Discussion page and select your default avatar.
Custom default gravatar

For detailed instructions, see our guide on how to change the default gravatar in WordPress.

6. Dynamic Copyright Date in WordPress Footer

You can simply add copyright date by editing the footer template in your theme. However, it will not show when your site started and it will not automatically change next year.

You can use this code to add a dynamic copyright date in WordPress footer.

function wpb_copyright() {
global $wpdb;
$copyright_dates = $wpdb->get_results("
SELECT
YEAR(min(post_date_gmt)) AS firstdate,
YEAR(max(post_date_gmt)) AS lastdate
FROM
$wpdb->posts
WHERE
post_status = 'publish'
");
$output = '';
if($copyright_dates) {
$copyright = "© " . $copyright_dates[0]->firstdate;
if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
$copyright .= '-' . $copyright_dates[0]->lastdate;
}
$output = $copyright;
}
return $output;
}

After adding this function, you’ll need to open your footer.php file and add the following code wherever you like to display the dynamic copyright date:

<?php echo wpb_copyright(); ?>

This function looks for the date of your first post, and the date of your last post. It then echos the years wherever you call the function.

For more details, see our guide on how to add dynamic copyright date in WordPress.

7. Randomly Change Background Color in WordPress

Do you want to randomly change background color on your WordPress upon each visit and page reload? Here is how to easily do this.

First you need to add this code to your theme’s functions file.

function wpb_bg() { 
$rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
$color ='#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].
$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
echo $color;
}

Next, you’ll need to edit the header.php file in your theme. Locate the <body> tag and add replace it with this line:

<body <?php body_class(); ?> style="background-color:<?php wpb_bg();?>">>

You can now save your changes and visit your website to see this in action.

Random background change in WordPress

For more details and alternate methods, see our tutorial on how to randomly change background color in WordPress.

8. Update WordPress URLs

If your WordPress login page keeps refreshing or you are unable to access admin area, then you need to update WordPress URLs.

One way to do this is by using wp-config.php file. However, if you do that you will not be able to set the correct address on the settings page. The WordPress URL and Site URL fields will be locked and uneditable.

If you want to fix this, then you should add this code to your functions file.

update_option( 'siteurl', 'http://example.com' );
update_option( 'home', 'http://example.com' );

Don’t forget to replace example.com with your own domain name.

Once you are logged in, you can go to Settings and set the URLs there. After that you should remove the code you added to the functions file, otherwise it will keep updating those URLs any time your site is accessed.

9. Add Additional Image Sizes in WordPress

WordPress automatically creates several image sizes when you upload an image. You can also create additional image sizes to use in your theme. Add this code your theme’s functions file.

add_image_size( 'sidebar-thumb', 120, 120, true ); // Hard Crop Mode
add_image_size( 'homepage-thumb', 220, 180 ); // Soft Crop Mode
add_image_size( 'singlepost-thumb', 590, 9999 ); // Unlimited Height Mode

This code creates three new image sizes with different sizes. Feel free to tweak the code to meet your own requirements.

You can display an image size in anywhere in your theme using this code.

<?php the_post_thumbnail( 'homepage-thumb' ); ?>

For detailed instructions, see our guide on how to create additional image sizes in WordPress.

10. Add New Navigation Menus to Your Theme

WordPress allows theme developers to define navigation menus and then display them. Add this code in your theme’s functions file to define a new menu location in your theme.

function wpb_custom_new_menu() {
  register_nav_menu('my-custom-menu',__( 'My Custom Menu' ));
}
add_action( 'init', 'wpb_custom_new_menu' );

You can now go to Appearance » Menus and you will see ‘My Custom Menu’ as theme location option.

New navigation menu

Now you need to add this code to your theme where you want to display navigation menu.

<?php
wp_nav_menu( array( 
    'theme_location' => 'my-custom-menu', 
    'container_class' => 'custom-menu-class' ) ); 
?>

For detailed instructions, see our guide on how to add custom navigation menus in WordPress themes.

11. Add Author Profile Fields

Do you want to add extra fields to your author profiles in WordPress? You can easily do that by adding this code to your functions file:

function wpb_new_contactmethods( $contactmethods ) {
// Add Twitter
$contactmethods['twitter'] = 'Twitter';
//add Facebook
$contactmethods['facebook'] = 'Facebook';

return $contactmethods;
}
add_filter('user_contactmethods','wpb_new_contactmethods',10,1);

This code will add Twitter and Facebook fields to user profiles in WordPress.

Extra user profile fields in WordPress

You can now display these fields in your author template like this:

<?php echo $curauth->twitter; ?>

You may also want to see our guide on how to add additional user profile fields in WordPress registration.

12. Adding Widget Ready Areas or Sidebar in WordPress Themes

This is one of the most used ones and many developers already know about this. But it deserves to be in this list for those who don’t know. Paste the following code in your functions.php file:

// Register Sidebars
function custom_sidebars() {

	$args = array(
		'id'            => 'custom_sidebar',
		'name'          => __( 'Custom Widget Area', 'text_domain' ),
		'description'   => __( 'A custom widget area', 'text_domain' ),
		'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',
		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>',
	);
	register_sidebar( $args );

}
add_action( 'widgets_init', 'custom_sidebars' );

You can now visit Appearance » Widgets page and you will see your new custom widget area.

Newly registered widget area in WordPress

To display this sidebar or widget ready area in your theme add this code:

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('custom_sidebar') ) : ?>
<!–Default sidebar info goes here–>
<?php endif; ?>

For more details see our guide on how to add dynamic widget ready areas and sidebars in WordPress.

13. Manipulate RSS Feed Footer

Have you seen blogs that adds their advertisement in their RSS Feeds below each post. You can accomplish that easily with a simple function. Paste the following code:


function wpbeginner_postrss($content) {
if(is_feed()){
$content = 'This post was written by Syed Balkhi '.$content.'Check out WPBeginner';
}
return $content;
}
add_filter('the_excerpt_rss', 'wpbeginner_postrss');
add_filter('the_content', 'wpbeginner_postrss');

For more information, see our guide on how to add content and completely manipulate your RSS feeds.

14. Add Featured Images to RSS Feeds

The post thumbnail or featured images are usually only displayed within your site design. You can easily extend that functionality to your RSS feed with a simple function in your RSS feed.

function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');

For more details see our guide on how to add post thumbnails to your WordPress RSS feed.

15. Hide Login Errors in WordPress

Login errors in WordPress can be used by hackers to guess whether they entered wrong username or password. By hiding login errors in WordPress you can make your login area a bit more secure.

function no_wordpress_errors(){
  return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );

Now users see a generic message when they enter incorrect username or password.

No login hints in WordPress

For more information, see our tutorial on how to disable login hints in WordPress login error messages.

16. Disable Login by Email in WordPress

WordPress allows users to login with username or email address. You can easily disable login by email in WordPress by adding this code to your functions file.

remove_filter( 'authenticate', 'wp_authenticate_email_password', 20 );

For more information see our guide on how to disable login by email feature in WordPress.

17. Disable Search Feature in WordPress

If you want to disable search feature on your WordPress site, then simply add this code to your functions file.

function fb_filter_query( $query, $error = true ) {

if ( is_search() ) {
$query->is_search = false;
$query->query_vars[s] = false;
$query->query[s] = false;

// to error
if ( $error == true )
$query->is_404 = true;
}
}

add_action( 'parse_query', 'fb_filter_query' );
add_filter( 'get_search_form', create_function( '$a', "return null;" ) );

For more information, see our tutorial on how to disable search feature in WordPress.

18. Delay Posts in RSS Feed

Sometimes you may end up with a grammar or spelling mistake in your article. The mistake goes live and is distributed to your RSS feed subscribers. If you have email subscriptions on your WordPress blog, then those subscribers will get it as well.

Simply add this code in your theme’s functions file.

function publish_later_on_feed($where) {

	global $wpdb;

	if ( is_feed() ) {
		// timestamp in WP-format
		$now = gmdate('Y-m-d H:i:s');

		// value for wait; + device
		$wait = '10'; // integer

		// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
		$device = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

		// add SQL-sytax to default $where
		$where .= " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
	}
	return $where;
}

add_filter('posts_where', 'publish_later_on_feed');

In this code we have used 10 minutes as $wait or delay time. Feel free to change that into any number of minutes you want.

For plugin method and more information, see our detailed guide on how to delay posts from appearing in WordPress RSS feed.

19. Change Read More Text for Excerpts in WordPress

Do you want to change the text that appears after the excerpt? Simply add this code to your theme’s functions file.

function modify_read_more_link() {
    return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
}
add_filter( 'the_content_more_link', 'modify_read_more_link' );

20. Disable RSS Feeds in WordPress

Not all websites need RSS feeds. If you want to disable RSS feeds on your WordPress site, then add this code to your theme’s functions file.

function fb_disable_feed() {
wp_die( __('No feed available,please visit our <a href="'. get_bloginfo('url') .'">homepage</a>!') );
}

add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
add_action('do_feed_atom', 'fb_disable_feed', 1);

For a plugin method and more information, see our guide on how to disable RSS feeds in WordPress.

21. Change Excerpt Length in WordPress

WordPress limits excerpt lengths to 55 words. If you need to change that, then you can add this code to your functions file.

functionnew_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');

Change 100 to the number of words you want to show in the excerpts.

For alternate method, you may want to take a look at our guide on how to customize WordPress excerpts (no coding required).

22. Add an Admin User in WordPress

If you have forgotten your WordPress password and email, then you can add an admin user by adding this code to your theme’s functions file using an FTP client.

function wpb_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = [email protected]';
if ( !username_exists( $user )  && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
} }
add_action('init','wpb_admin_account');

Don’t forget to fill in the username, password, and email fields. Once you login to your WordPress site, don’t forget to delete the code from your functions file.

For more on this topic, take a look at our tutorial on how to add an admin user in WordPress using FTP.

23. Remove Welcome Panel from WordPress Dashboard

Welcome panel is a meta box added to the dashboard screen of WordPress admin area. It provides useful shortcuts for beginners to do things on their new WordPress site.

Welcome panel in WordPress admin dashboard

You can easily hide by adding this code in your functions file.

remove_action('welcome_panel', 'wp_welcome_panel');

For other methods and more details check out our guide on how to remove welcome panel in WordPress dashboard.

24. Show Total Number of Registered Users in WordPress

Do you want to show total number of registered users on your WordPress site? Simply add this code to your theme’s functions file.

// Function to return user count
function wpb_user_count() { 
$usercount = count_users();
$result = $usercount['total_users']; 
return $result; 
} 
// Creating a shortcode to display user count
add_shortcode('user_count', 'wpb_user_count');

This code creates a shortcode that allows you to display total number of registered users on your site. Now you just need to add this shortcode to [user_count] your post or page where you want to show the total number of users.

For more information and a plugin method, see our tutorial on how to display total number of registered users in WordPress.

25. Exclude Specific Categories from RSS Feed

Do you want to exclude specific categories from your WordPress RSS feed? Add this code to your theme’s functions file.

function exclude_category($query) {
	if ( $query->is_feed ) {
		$query->set('cat', '-5, -2, -3');
	}
return $query;
}
add_filter('pre_get_posts', 'exclude_category');

26. Enable Shortcode Execution in Text Widgets

By default, WordPress does not execute shortcodes inside text widgets. To fix this you need to simply add this code to your theme’s functions file.

// Enable shortcodes in text widgets
add_filter('widget_text','do_shortcode');

For an alternate method and more information, take a look at our guide on how to use shortcodes in WordPress sidebar widgets.

27. Add Odd and Even CSS Classes to WordPress Posts

You may have seen WordPress themes using an old or even class for WordPress comments. It helps users visualize where one comment ends and the next one begins.

You can use the same technique for your WordPress posts. It looks aesthetically pleasing and helps users quickly scan pages with lots of content. Simply add this code to your theme’s functions file.

function oddeven_post_class ( $classes ) {
   global $current_class;
   $classes[] = $current_class;
   $current_class = ($current_class == 'odd') ? 'even' : 'odd';
   return $classes;
}
add_filter ( 'post_class' , 'oddeven_post_class' );
global $current_class;
$current_class = 'odd';

This code simply adds an odd or even class to WordPress posts. You can now add custom CSS to style them differently. Here is a sample code to help you get started.

.even {
background:#f0f8ff;  
} 
.odd {
 background:#f4f4fb;
}

The end result will look something like this:

Alternate colors used for WordPress posts using odd and even CSS classes

Need more detailed instructions? Take a look at our tutorial on how to add odd/even class to your post in WordPress themes.

28. Add Additional File Types to be Uploaded in WordPress

By default, WordPress allows you to upload a limited number of most commonly used file types. However, you can extend it to allow other file types. Add this code to your theme’s functions file:

function my_myme_types($mime_types){
    $mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
    $mime_types['psd'] = 'image/vnd.adobe.photoshop'; //Adding photoshop files
    return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);

This code allows you to upload SVG and PSD files to WordPress. You will need to Google to find out the mime types for the file types you want to allow and then use it in the code.

For more on this topic, check out our tutorial on how to add additional file types to be uploaded in WordPress.

By default, when you uplaod an image in WordPress it is automatically linked to the image file or the attachment page. If users click on the image they are then taken to a new page away from your post.

Here is how you can easily stop WordPress from automatically linking image uploads. All you have to do is to add this code snippet to your functions file:

function wpb_imagelink_setup() {
	$image_set = get_option( 'image_default_link_type' );
	
	if ($image_set !== 'none') {
		update_option('image_default_link_type', 'none');
	}
}
add_action('admin_init', 'wpb_imagelink_setup', 10);

Now when you upload a new image in WordPress, it will not be automatically linked. You can still link it to the file or attachment page if you want.

Disable default image links in WordPress

You may want to check out our tutorial on how to remove default image links in WordPress for an alternate plugin method and more information.

30. Add an Author Info Box in WordPress Posts

If you run a multi-author site and want to showcase author bios at the end of your post, then you can try this method. Start by adding this code to your functions file:

function wpb_author_info_box( $content ) {

global $post;

// Detect if it is a single post with a post author
if ( is_single() && isset( $post->post_author ) ) {

// Get author's display name 
$display_name = get_the_author_meta( 'display_name', $post->post_author );

// If display name is not available then use nickname as display name
if ( empty( $display_name ) )
$display_name = get_the_author_meta( 'nickname', $post->post_author );

// Get author's biographical information or description
$user_description = get_the_author_meta( 'user_description', $post->post_author );

// Get author's website URL 
$user_website = get_the_author_meta('url', $post->post_author);

// Get link to the author archive page
$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));
 
if ( ! empty( $display_name ) )

$author_details = '<p class="author_name">About ' . $display_name . '</p>';

if ( ! empty( $user_description ) )
// Author avatar and bio

$author_details .= '<p class="author_details">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</p>';

$author_details .= '<p class="author_links"><a href="'. $user_posts .'">View all posts by ' . $display_name . '</a>';  

// Check if author has a website in their profile
if ( ! empty( $user_website ) ) {

// Display author website link
$author_details .= ' | <a href="' . $user_website .'" target="_blank" rel="nofollow">Website</a></p>';

} else { 
// if there is no author website then just close the paragraph
$author_details .= '</p>';
}

// Pass all this info to post content  
$content = $content . '<footer class="author_bio_section" >' . $author_details . '</footer>';
}
return $content;
}

// Add our function to the post content filter 
add_action( 'the_content', 'wpb_author_info_box' );

// Allow HTML in author bio section 
remove_filter('pre_user_description', 'wp_filter_kses');

Next you will need to add some custom CSS to make it look better. You can use this sample CSS as an starting point.

.author_bio_section{
background: none repeat scroll 0 0 #F5F5F5;
padding: 15px;
border: 1px solid #ccc;
}

.author_name{
font-size:16px;
font-weight: bold;
}

.author_details img {
border: 1px solid #D8D8D8;
border-radius: 50%;
float: left;
margin: 0 10px 10px 0;
}

This is how your author box would look like:

Author box

For plugin method and more detailed instructions, check out our article on how to add an author info box in WordPress posts.

31. Disable XML-RPC in WordPress

XML-RPC is a method that allows third party apps to communicate with your WordPress site remotely. This could cause security issues and can be exploited by hackers.

Simply add this code to your functions file to turn off XML-RPC in WordPress:

add_filter('xmlrpc_enabled', '__return_false');

You may want to read our article on how to disable XML-RPC in WordPress for more information.

32. Automatically Link Featured Images to Posts

If your WordPress theme does not automatically link featured images to full articles, then you can try this method. Simply add this code to your theme’s functions file.

function wpb_autolink_featured_images( $html, $post_id, $post_image_id ) {

If (! is_singular()) { 
	
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>';
return $html;

} else { 

return $html;

}

}
add_filter( 'post_thumbnail_html', 'wpb_autolink_featured_images', 10, 3 );

You may want to read our article on how to automatically link featured images to posts in WordPress.

That’s all for now.

We hope this article helped you learn some new useful tricks for functions.php file in WordPress. You may also want to see our ultimate guide to boost WordPress speed and performance.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 32 Extremely Useful Tricks for the WordPress Functions File appeared first on WPBeginner.

Entitlement is the Road to Disappointment

Many writers and sociologists have referred to the era in which we live as the “age of entitlement.” People’s expectations of life have never been higher; therefore, disappointments have never been greater. How can we avoid being entitled? How can we find the line between standing up for what we deserve and expecting too much? … Continue reading Entitlement is the Road to Disappointment

Many writers and sociologists have referred to the era in which we live as the “age of entitlement.” People’s expectations of life have never been higher; therefore, disappointments have never been greater. How can we avoid being entitled? How can we find the line between standing up for what we deserve and expecting too much?

The type of entitlement I will discuss in this lesson is defined as such: the belief that you deserve special treatment and privileges just for being you. This attitude is the antithesis of humility and the enemy of growth.

Entitled people:

  • Are rude when they don’t get their way
  • Expect others to do favors for them
  • Assume they’ll be rewarded merely for participation
  • Are often angry at their unmet and unspoken expectations of others
  • Feel victimized when they are not treated as extraordinary
  • Suffer chronic disappointment as a result of their expectations

People who seem entitled are likely to lose the respect of their peers, the patience of their leaders, and the accommodation of their friends.

Here are five ways to avoid entitlement:

  1. Get to the heart of the issue. Look within. Do you believe that you are worth more than those around you? Do you think you deserve a prize just for being you? This isn’t meant to deter you from being confident; it’s meant to stop you from becoming prideful. Confidence is well founded in experience and excellence. Pride, on the other hand, is flimsy and unmerited. You are a wonderful creation, but that doesn’t mean you are inherently worth more than those around you.
  1. Look to peers before asking favors of leadership. Before you ask for or expect something, be honest with yourself. Does the value that you are bringing truly match up with the rewards or income that you are expecting? Look to others who are offering similar value before you ask for special favors—but be careful not to use comparison as a foundation for entitlement (i.e. “John got X, so why didn’t I get X too?”).
  1. Ask with humility. Whenever you ask anyone to go out of their way to do something for you, be conscious of how you posture yourself when you ask. If you come across as expectant, people will often hesitate to do you any favors. If you come across humble and grateful, they are much more likely to respond with a willingness to help.
  1. Respond to disappointments with grace. There will always be times when we don’t get what we want. Whether it’s witnessing a beloved project crash and burn or not being offered that well-deserved promotion, we will face failure and disappointments. When these issues arise, be careful how you respond and to whom you direct your criticism or negativity. If those around you think that you blame them for your personal failings, they will be much less likely to help you succeed in the future.

Look first at yourself and the ways that you can improve. If you still believe that others are at least partially to blame, make a point to communicate all future expectations to them without passing blame. Avoid becoming angry or bitter in the face of disappointment. This makes you look spoiled and childish and will cause others to lose respect for you.

  1. Be grateful. Brené Brown, acclaimed author and life coach, once said, “The difference between privilege and entitlement is gratitude.” Whenever someone does something nice for you, your response should always be appreciation. Go the extra mile to show that you are grateful and honored by what others do for you.

Whether it’s giving advice on how to advance your career or picking up ice on the way to an event, never let a kind deed go without a “thank you.” Being grateful will make you a happier, more content person.

LTM Challenge

Look at your interactions with your coworkers, leaders, and even your friends. Do you sometimes feel as though you are not getting what is owed to you? Analyze the situation. Is this a result of an unhealthy relationship, where you’re not being seen or appreciated, or is it because of prideful expectation?

You reap what you sow. Before you expect a harvest, first look into the soil to ensure that what you’re sowing is adequate to achieve you goals.

How to Display Category Descriptions in WordPress

Do you want to display category descriptions on your WordPress site? Categories allow you to easily sort content on your website. They also help users easily find content and are good for SEO. In this article, we will show you how to easily display category… Read More »

The post How to Display Category Descriptions in WordPress appeared first on WPBeginner.

Do you want to display category descriptions on your WordPress site? Categories allow you to easily sort content on your website. They also help users easily find content and are good for SEO. In this article, we will show you how to easily display category descriptions in WordPress.

How to display category description in WordPress

Adding Category Descriptions in WordPress

WordPress comes with two built-in taxonomies called categories and tags. These taxonomies allow you to easily sort your content into different topics.

When used correctly, categories and tags can also be very helpful in improving your WordPress SEO.

WordPress allows you to add descriptions for your categories. However, many users don’t notice it because they create categories when writing a post which doesn’t let them add description.

Here is how to easily add description to your categories.

Head over to Posts » Categories page. If you are creating a new category, then you can simply enter category name and description here and then click on ‘Add new category’ button.

Add category description

If you want to add description to an existing category, then you need to click on the ‘Edit’ link below that category.

This will take you to category edit screen where you can add description for your category.

Editing a category to add description

Don’t forget to click on the ‘Update’ button to save your changes.

Repeat the process to add descriptions to all your categories. You can use the same method to add descriptions for tags as well.

Display Category Description on Category Archive Page

Most WordPress themes will automatically display the category description on the category archive pages.

Category description shown on category archive page in WordPress

However if your theme does not display category description on archive pages, then you will need to edit your theme files.

Connect to your WordPress site using an FTP client and then go to /wp-content/themes/your-current-theme/ folder.

Now you will need to locate and edit category.php file. If your theme doesn’t have category.php file, then you will need to edit archive.php file.

Copy and paste this code where you would like the category description to be displayed.

<?php 
the_archive_description( '<div class="taxonomy-description">', '</div>' ); 
?>

You can now save your changes and upload the file back to your website.

After that, you can visit the category archive page on your website to see the description in action.

Display Category Description in WordPress Theme

If you want to display the category description in other parts of your website, then you can also use the category_description template tag:

<?php echo category_description(3); ?>

Don’t forget to replace 3 with your own category ID.

If you want to display category description inside a single post, then you can use this code.

$catID = get_the_category();
echo category_description( $catID[0] ); 

This code simply gets all categories for the current post and then outputs the category description of the first category.

If you would like to list all your WordPress categories with a description in list format, then you can add this code in your theme’s functions.php file:

function wpb_catlist_desc() { 
$string = '<ul>';
$catlist = get_terms( 'category' );
if ( ! empty( $catlist ) ) {
  foreach ( $catlist as $key => $item ) {
    $string .= '<li>'. $item->name . '<br />';
    $string .= '<em>'. $item->description . '</em> </li>';
  }
}
$string .= '</ul>';

return $string; 
}
add_shortcode('wpb_categories', 'wpb_catlist_desc');

This code creates a shortcode which displays all your categories and their descriptions in a plain list.

You can now use [wpb_categories] in your posts and pages. To use this shortcode inside a text widget, you will need to enable shortcodes for widgets.

List WordPress categories with description

We hope this article helped you learn how to add and display category descriptions in WordPress. You may also want to see our list of most wanted category hacks and plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Display Category Descriptions in WordPress appeared first on WPBeginner.

Temporary Fix: Logitech BRIO Camera broken on Windows 10 Insiders 15042

I just updated my Windows 10 to Insiders Fast Build 15042, and suddenly my glorious new Logitech BRIO 4k webcam doesn’t work! Well, it’s all beta software, but it turns out the issue is with something in the Logitech INF files for their drivers. I’m assuming they’ll figure it out, but the nutshell is that the first install works, but the driver gets messed up on the upgrade. You can’t just pull out the camera and put it in again, you need to DELETE the drivers and have them redownloaded by Windows Update/Device Manager.

Here’s a temporary fix (either until Logitech fixes it and it shows up in Windows Update or you take another Windows 10 upgrade):

Logitech BRIO stops working on Windows 10 Insiders UPGRADE

Go to device manager and right click the device and Uninstall Driver. If it has the checkbox “Delete this driver” then check it. That’s required. IF (like me) you don’t have that checkbox (I’m not sure why I don’t) then you’ll need to delete the Logitech driver from the DriverStore. You can do it manually but it’s tricky and messy and hard.

We need to delete this driver so it gets reinstalled cleanly.

Driver 2/31/2017

Unplug your webcam. Then, go get the latest copy of DriverStoreExplorer from here https://github.com/lostindark/DriverStoreExplorer/releases and delete JUST this one driver.

Using the Driver Store Explorer

Now, go back to Device Manager and plug in your Logitech BRIO webcam. Note you’ll get some super old 2006 driver. Right click the BRIO in Imaging Devices and Update Driver. This will get you BACK to your original state. You still have a driver that will break when you next take a “major” Windows update or Insiders Build, but at least you have a solution until it magically gets fixed.

Yay!


Sponsor: Big thanks to Progress! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is still a viable language. Check it out!


© 2016 Scott Hanselman. All rights reserved.
     

I just updated my Windows 10 to Insiders Fast Build 15042, and suddenly my glorious new Logitech BRIO 4k webcam doesn't work! Well, it's all beta software, but it turns out the issue is with something in the Logitech INF files for their drivers. I'm assuming they'll figure it out, but the nutshell is that the first install works, but the driver gets messed up on the upgrade. You can't just pull out the camera and put it in again, you need to DELETE the drivers and have them redownloaded by Windows Update/Device Manager.

Here's a temporary fix (either until Logitech fixes it and it shows up in Windows Update or you take another Windows 10 upgrade):

Logitech BRIO stops working on Windows 10 Insiders UPGRADE

Go to device manager and right click the device and Uninstall Driver. If it has the checkbox "Delete this driver" then check it. That's required. IF (like me) you don't have that checkbox (I'm not sure why I don't) then you'll need to delete the Logitech driver from the DriverStore. You can do it manually but it's tricky and messy and hard.

We need to delete this driver so it gets reinstalled cleanly.

Driver 2/31/2017

Unplug your webcam. Then, go get the latest copy of DriverStoreExplorer from here https://github.com/lostindark/DriverStoreExplorer/releases and delete JUST this one driver.

Using the Driver Store Explorer

Now, go back to Device Manager and plug in your Logitech BRIO webcam. Note you'll get some super old 2006 driver. Right click the BRIO in Imaging Devices and Update Driver. This will get you BACK to your original state. You still have a driver that will break when you next take a "major" Windows update or Insiders Build, but at least you have a solution until it magically gets fixed.

Yay!


Sponsor: Big thanks to Progress! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is still a viable language. Check it out!


© 2016 Scott Hanselman. All rights reserved.
     

30+ Best Portfolio WordPress Themes for Your Website (2017)

Are you looking for the best WordPress portfolio themes? WordPress is the perfect tool to create beautiful portfolio websites to showcase your work and get new clients. In this article, we will share our expert pick of the best WordPress Portfolio themes, so you can… Read More »

The post 30+ Best Portfolio WordPress Themes for Your Website (2017) appeared first on WPBeginner.

Are you looking for the best WordPress portfolio themes? WordPress is the perfect tool to create beautiful portfolio websites to showcase your work and get new clients. In this article, we will share our expert pick of the best WordPress Portfolio themes, so you can get started the right away.

Best WordPress themes for portfolios

Building a Portfolio Website with WordPress

Choosing the right platform for your portfolio website is crucial for the success. Self hosted WordPres.org website gives you the flexibility and freedom to build a website that not only showcases your talents but helps you get more work.

To get started, first you will need to sign up for a WordPress hosting account. This is where your website will live on the internet.

You will also need a domain name. This will be the address of your website (example: wpbeginner.com or google.com).

We recommend that you use either Bluehost or SiteGround. These are one of the largest hosting companies in the world and an official WordPress hosting partner.

Once you have signed up for a hosting account, you will need to install WordPress. Follow the instructions in our step by step guide on how to start a WordPress blog and you will be up and running in no time.

After installing WordPress you will be able to select a theme for your website. You can pick any theme from our expert selection below and then head over to our guide on how to install a WordPress theme to set it up.

Having said that, now let’s take a look at the best WordPress portfolio themes currently available in the market. This list contains a selection of both free and premium WordPress themes and all of them are fully mobile-responsive.

1. Modern Portfolio Pro

Modern Portfolio

Modern Portfolio Pro is an elegant WordPress portfolio theme from StudioPress. It is built on top of the rock solid core of Genesis theme framework.

Modern Portfolio features a minimalist layout with focus on beautiful display of your images and photos.
It has with multiple page layouts for blog, homepage, landing pages, etc. It is easy to setup using the live theme customizer. The homepage is made of widget ready areas allowing you to drag and drop items on your homepage.

2. Ambiance Pro

Ambiance Pro

Ambiance Pro is a WordPress portfolio theme built on Genesis framework. Designed specifically to beautifully showcase your photos and images, Ambiance Pro comes with beautiful layout choices and elegant typography.

It comes with multiple page templates for your blog, archives, and landing pages. It is quick and easy to setup using the live theme customizer. It has two navigation menus one at the top and the other one at the bottom. The homepage is fully widgetized so you can easily set it up in minutes.

3. Expose Pro

Expose Pro

Expose Pro is another elegant and stylish WordPress portfolio theme by StudioPress. It comes with a widgetized homepage with four widget areas and has multiple templates for your blog, homepage, archive, and landing pages.

Expose Pro is designed to beautifully showcase your photography. It uses large image display and has a custom gallery post format with lightbox display of your photos. It is quick and easy to set up and is highly optimized for speed and performance.

4. Candid

Candid

Candid is a stunningly beautiful WordPress multi-purpose theme with a minimalist style portfolio section baked in. If you want to showcase different kind of multi-media in a storytelling format, then you’d like Candid.

It comes in a beautiful grid based two column layout for the homepage. It beautifully displays featured images, videos, and uses crisp typography that looks great on all devices.

5. Camera

Camera

As the name suggests, Camera is a gorgeous WordPress portfolio theme for photographers, illustrators, and visual artists. It focuses on a stunningly beautiful display of large images with elegant typography that allows you to add rich storytelling element to your images.

It features a distraction free layout with collapsible menu and sidebar. It is easy to setup and avoids confusing users with complicated options. It comes with a built-in getting started dashboard that will help you set up the theme in minutes.

6. Designer

Designer

Designer is a beautiful WordPress portfolio theme for designers, artists, photographers, and storytellers. It uses a beautiful grid-based two column layout on the homepage and comes with a beautiful portfolio display.

It focuses on making sure that your images pop out and no other design elements distracts users away. It has collapsible menu and sidebar and comes with getting started dashboard to help you get started.

7. Pocket

Pocket

Pocket is a minimalist photography and portfolio WordPress theme. It features gorgeous typography and large display of features images and headers. There are no sidebars except for the one widget ready area at the bottom.

It comes with one navigation menu at the top and a social media links menu at the bottom. Due to its super-minimalist approach to design, Pocket is very easy to set up and is highly optimized for speed and performance.

8. North

North

North is another awesome WordPress portfolio theme with a grid based layout. It comes with beautiful portfolio templates to beautifully display images, photos, videos, and audio files.

It comes with multiple color choices, supports posts formats, and can be used with third party gallery plugins to create beautiful photo galleries.

9. Verb

Verb

Verb is a WordPress portfolio theme for designers, artists, photographers, etc. It features a gorgeous design with a grid layout on the homepage and full-width pages for portfolio items and pages.

Verb allows you to customize colors and upload custom logo from the live theme customizer.

10. Peak

Peak

Peak is a modern WordPress portfolio theme featuring a tile based display of images in a responsive grid layout.

It comes with multiple layouts for pages as well as posts. It features a mega menu on top, social media menu, and slide-in sidebar widgets.

11. Aesthetic

Aesthetic

Aesthetic is a stylish WordPress portfolio theme suitable for photographers, stylists, designers, etc. It comes with a built-in portfolio section, multiple layout choices, and unlimited colors.

It also comes with multiple sidebars and a drag and drop page builder. It also fully supports WooCommerce and can be used to run your own online store.

12. Resume

Resume

Resume is a bold WordPress portfolio theme. It comes with a built-in portfolio management area, custom widgets, and a drag and drop homepage builder.

It can also be used as a single page theme where all your website sections are displayed on the homepage.

13. Exposure

Exposure

Exposure is a stylish multi-purpose WordPress theme with portfolio management system built-in. It is ideal for photography, fashion, lifestyle, arts and crafts websites.

It comes with a drag and drop page builder which allows you to design your pages the way you want. It has lots of customization options built-in and it is fully mobile responsive.

14. Corner

Corner

Corner is a minimalist style WordPress portfolio theme for artists, designers and photographers. It comes with a built-in portfolio management area and custom widgets for Twitter and Flickr.

It has multiple page layouts and you can choose your own colors. It supports WooCommerce and is tested with popular WordPress page builder plugins.

15. Elegant

Elegant

Elegant is a powerful WordPress theme for portfolios. It comes with a built-in portfolio management area and comes with multiple grid and column based layouts. It also comes with image filters that you can apply to your photos after uploading them.

The theme comes with its own drag and drop page builder with several built-in templates to quickly create different kind of landing pages. It features gorgeous typography and comes with several custom widgets.

16. Angle

Angle

Angle is a flexible WordPress multi-purpose theme with portfolio section. It comes with a drag and drop page builder, multiple layout options, and several custom widgets.

It is designed to be suitable for portfolio, blogging, photography, and even as a business website. It is easy to set up and optimized for speed and SEO.

17. Coastline

Coastline

Coastline is a uniquely beautiful WordPress portfolio theme. It comes with portfolio content type, powerful custom widgets, and multiple layout choices.

It features a fixed left sidebar with custom background support and comes with different page templates for blog, portfolio, archives, and galleries.

18. True North

True North

True North is a flexible WordPress portfolio theme with a beautiful design. It comes with multiple layout choices and built-in portfolio section. It features grid based layout on the home page with beautiful display of images.

True North supports custom background, custom header, and comes with several custom widgets for social media.

19. Memories

Memories

Memories is a beautiful WordPress photography theme with elegant display of your portfolio items. It does not have a portfolio content type, instead it comes with a gallery display that showcases your photographs, designs, and other visual artworks beautifully.

The theme comes with multiple color schemes and has multiple layout choices. It comes with custom background and header support as well as custom widgets for your social media profiles.

20. Nico

Nico

Nico is another elegantly designed WordPress portfolio theme for photographers, artists, designers, etc. It comes with a beautiful filterable portfolio section and flexible layout options for different pages on your site.

Nico comes with multiple color schemes and has support for custom backgrounds, headers, widgets, etc.

21. Vignette

Vignette

Vignette is a powerful WordPress multi-purpose theme designed specifically for photographers. The homepage features a full screen header where you can use an image or a video with your call to action.

Vignette does not come with a portfolio filter type. Instead it comes with image galleries to showcase your work. It has flexible customization options with support for custom headers, background, multiple page layouts and color schemes.

22. Mozzy

Mozzy

Mozzy is a bright WordPress portfolio theme for illustrators, graphic designers, photographers, etc. It features a customizable homepage with slider and featured content areas.

It comes with built-in sections for portfolio, services, and clients. It comes with support for custom post formats, backgrounds, headers, and social widgets.

23. Mustache

Mustache

Mustache is a single page WordPress portfolio theme for designers, artists, photographers, etc. It is flexible to be used as a onepage theme or a multi-page theme. It comes with built-in portfolio, clients, services, and team members content types.

Mustache features a gorgeous and truly unique design with custom logo support. It comes with Google Maps and contact form support as well.

24. Draft

Draft

Draft is a minimalist style free WordPress portfolio theme. It uses featured images to display a grid based layout on the homepage. Ideal for photographers to showcase their work. It supports theme customization using live customizer and comes with a single navigation menu on top.

25. Shapely

Shapely

Shapely is a highly customizable free WordPress portfolio theme. It is designed to be flexible enough for single page websites as well as multi-page sites. It features a beautiful display of featured images and comes with large custom header support.

It has a fully widgetized homepage where you can just drag and drop widgets to add portfolio, testimonials, and parallax sections.

26. Nikkon

Nikkon

Nikkon is a free WordPress photography and portfolio theme. It is designed to beautifully showcase images in a grid based layout on the homepage. It offers multiple header layouts, footer layouts and multiple page templates. It supports WooCommerce out of the box and comes with easy customization options.

27. Pixgraphy

Pixgraphy

Pixgraphy is an elegant and free WordPress portfolio theme. The homepage features a large header image or custom slider with a grid based layout using featured images. It supports many popular free plugins out of the box and is fully compatible with Polylang plugin to build multilingual websites.

28. Gridsby

Gridsby

Gridsby is a free Pinterest style WordPress portfolio theme designed specifically for photographers, curators, artists, etc. The homepage is built using featured images from blog posts in a beautiful grid based layout. It also uses homepage gallery as a feature to showcase your photos on the homepage.

29. Bailey

Bailey

Bailey is a flexible WordPress portfolio theme for interior designers, photographers, and other creative types. It comes with a built-in section for projects allowing you to easily add portfolio items with full details and images.

The theme supports multiple page layouts with multiple sidebar options. It also comes with several ready to use custom widgets for social media, simple slider, and featured content slider.

30. Videographer

Videographer

As the name suggests, Videographer is a WordPress portfolio theme for video producers, filmmakers, and photographers. It features a large fullscreen header video section on the homepage. It comes with a drag and drop page editor, tons of shortcodes, and several ready-to-use custom widgets.

Videographer also offers page templates, with multiple sidebar options. It comes with different color schemes and it is very easy to setup.

31. Remi

Remi

Remi is another beautiful WordPress portfolio and photography theme. It comes with built in content type to add and manage your projects and portfolio items. It comes with multiple layout options and several custom widgets. It comes with Google Maps and Google fonts support and can be easily customized using live customizer.

That’s all for now.

We hope this article helped you find the perfect WordPress theme for portfolio websites. You may also want to see our complete step by step WordPress SEO guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 30+ Best Portfolio WordPress Themes for Your Website (2017) appeared first on WPBeginner.

Xamarin .NET Workbooks – Interactive Computing is a stellar learning tool

I’ve been thinking a lot about how to best teach .NET and C#/F# to folks who are new to the space. We’ve added an in-browser no-install C# tutorial at http://dot.net. You can run through almost a few days lessons in C# without installing anything. Heck, it’s useful even if you just want to brush up on your skills.

When I spoke with Safia Abdalla a few months ago she re-introduced me to the ideas behind Interactive Computing and the whole ecosystem around Jupyter Notebooks, and the Nteract project Safia works on. It’s pretty amazing.

Pythonistas are familiar with Jupyter and the idea of a notebook that cleanly mixes prose and code. This ecosystem is very friendly to data scientists that are (perhaps) more scientist and less developer. People for whom an IDE is not as interesting as “electric paper.”

In fact, many people don’t realize that the Microsoft Azure Cloud supports hosting of Jupyter Notebooks using Python, R, and F#.

Azure Notebooks

Notebooks are a great learning resource that go beyond a REPL (an simple interactive console) in that they are effectively textbooks with islands of interactive code. It’s even more powerful when you consider graphics, charts, and other interactive models.

Xamarin has a thing called Xamarin Workbooks (I’m calling them .NET Workbooks in my head) that you should download and check out RIGHT NOW. Go get Xamarin Workbooks & Inspector for Windows (or download for Mac). Start playing around with workbooks or try out the samples.

I’m going to try teaching my C# and .NET courses for at least the first day or two using Xamarin .NET Workbooks. I think they have huge potential and I’m thrilled that Miguel and friends are investing so much in them. The potential for these as a learning tool that sits between a REPL and an IDE is huge.

The page at https://developer.xamarin.com/workbooks/ is FILLED with amazing example workbooks and lessons, and it’s growing. It has section not only on C# but Android, Games, Graphics as a concept, iOS, WPF, and so much more.

I run it and start here:

Xamarin Workbooks

Then I start typing…prose first! Just real sentences. Then I add some code. Notice that I’m not doing Console.WriteLine, I’m just assigning a variable. Xamarin Workbooks makes a nice visualization of my variable.

var scott = "Hanselman"

The prose is ignored (by the compiler) but the code cells and built upon each other and when you execute one you’re executing up to that point. Great for building up concepts.

You can print in other libraries and built upon them like in this chart example using the Urho library.

Charts in Xamarin Workbooks

Not to put to fine a point on it, but you can write really fully featured examples or games in Xamarin Workbooks. Here’s a fully 3D realized planet earth WITH SATELLITES. Again, with not just sample code but explanatory prose. It’s a textbook come to life.

THIS is how I wish I learned programming 25 years ago. I’d loved to have turned (or demo’ed) a .workbook file. I’m thrilled to see C# folks be able to do simple things that Jupyter users have enjoyed for so long.

3D Earth in Xamarin Workbooks

What do you think? Would this be a good way to deliver a course on learning .NET and C#?


Sponsor: Big thanks to Progress! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is still a viable language. Check it out!


© 2016 Scott Hanselman. All rights reserved.
     

I've been thinking a lot about how to best teach .NET and C#/F# to folks who are new to the space. We've added an in-browser no-install C# tutorial at http://dot.net. You can run through almost a few days lessons in C# without installing anything. Heck, it's useful even if you just want to brush up on your skills.

When I spoke with Safia Abdalla a few months ago she re-introduced me to the ideas behind Interactive Computing and the whole ecosystem around Jupyter Notebooks, and the Nteract project Safia works on. It's pretty amazing.

Pythonistas are familiar with Jupyter and the idea of a notebook that cleanly mixes prose and code. This ecosystem is very friendly to data scientists that are (perhaps) more scientist and less developer. People for whom an IDE is not as interesting as "electric paper."

In fact, many people don't realize that the Microsoft Azure Cloud supports hosting of Jupyter Notebooks using Python, R, and F#.

Azure Notebooks

Notebooks are a great learning resource that go beyond a REPL (an simple interactive console) in that they are effectively textbooks with islands of interactive code. It's even more powerful when you consider graphics, charts, and other interactive models.

Xamarin has a thing called Xamarin Workbooks (I'm calling them .NET Workbooks in my head) that you should download and check out RIGHT NOW. Go get Xamarin Workbooks & Inspector for Windows (or download for Mac). Start playing around with workbooks or try out the samples.

I'm going to try teaching my C# and .NET courses for at least the first day or two using Xamarin .NET Workbooks. I think they have huge potential and I'm thrilled that Miguel and friends are investing so much in them. The potential for these as a learning tool that sits between a REPL and an IDE is huge.

The page at https://developer.xamarin.com/workbooks/ is FILLED with amazing example workbooks and lessons, and it's growing. It has section not only on C# but Android, Games, Graphics as a concept, iOS, WPF, and so much more.

I run it and start here:

Xamarin Workbooks

Then I start typing...prose first! Just real sentences. Then I add some code. Notice that I'm not doing Console.WriteLine, I'm just assigning a variable. Xamarin Workbooks makes a nice visualization of my variable.

var scott = "Hanselman"

The prose is ignored (by the compiler) but the code cells and built upon each other and when you execute one you're executing up to that point. Great for building up concepts.

You can print in other libraries and built upon them like in this chart example using the Urho library.

Charts in Xamarin Workbooks

Not to put to fine a point on it, but you can write really fully featured examples or games in Xamarin Workbooks. Here's a fully 3D realized planet earth WITH SATELLITES. Again, with not just sample code but explanatory prose. It's a textbook come to life.

THIS is how I wish I learned programming 25 years ago. I'd loved to have turned (or demo'ed) a .workbook file. I'm thrilled to see C# folks be able to do simple things that Jupyter users have enjoyed for so long.

3D Earth in Xamarin Workbooks

What do you think? Would this be a good way to deliver a course on learning .NET and C#?


Sponsor: Big thanks to Progress! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is still a viable language. Check it out!



© 2016 Scott Hanselman. All rights reserved.
     

Do You Really Need a VPS? Best WordPress VPS Hosting Compared – 2017

Are you looking to compare the best VPS hosting services for WordPress? Finding the best VPS hosting for WordPress can be overwhelming with so many different options in the market. Sometimes VPS isn’t even the best option for your needs. Just because your website has outgrown… Read More »

The post Do You Really Need a VPS? Best WordPress VPS Hosting Compared – 2017 appeared first on WPBeginner.

Are you looking to compare the best VPS hosting services for WordPress?

Finding the best VPS hosting for WordPress can be overwhelming with so many different options in the market. Sometimes VPS isn’t even the best option for your needs. Just because your website has outgrown shared hosting doesn’t mean that you need a VPS.

Maybe you need managed WordPress hosting or even a dedicated server.

It’s extremely important to understand the Pros and Cons of VPS hosting, so you can make the right decision for your needs.

WPBeginner is the largest independent WordPress resource site that receives millions of pageviews per month. Having helped 100,000+ users and years of experience with WordPress hosting companies, we have created the most comprehensive guide that will help you understand everything you need to know about VPS hosting as well as compare the top VPS hosting companies, so you can choose the best VPS hosting service for WordPress.

Read the full comparison here.

The post Do You Really Need a VPS? Best WordPress VPS Hosting Compared – 2017 appeared first on WPBeginner.

How to Create a Filterable Portfolio in WordPress

Do you want to add a filterable portfolio in WordPress? A filterable portfolio allows users to sort items in your portfolio based on tags. This helps you showcase different styles of your work, and your users can discover items that interest them. In this article,… Read More »

The post How to Create a Filterable Portfolio in WordPress appeared first on WPBeginner.

Do you want to add a filterable portfolio in WordPress? A filterable portfolio allows users to sort items in your portfolio based on tags. This helps you showcase different styles of your work, and your users can discover items that interest them. In this article, we will show you how to easily create a filterable portfolio in WordPress.

How to create a filterable portfolio in WordPress

Why Create a Filterable Portfolio in WordPress?

Normally, most photographers and designers just create a beautiful portfolio showing their best photographs. However sometimes those looking to hire you may want to see if you have done something similar before.

For example, someone looking for a fashion photographer may want to see your work in fashion.

Example of a filterable portfolio gallery

Adding filters to your portfolio allows you to show your work under different tags. It also helps your users to easily sort items in your portfolio.

Having said that, let’s take a look at how to easily create a filterable portfolio in WordPress without writing any code.

Creating a Filterable Portfolio in WordPress

First, you will need to install and activate the Envira Gallery plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Envira Gallery is one of our premium WordPress plugin, and you will need at least the silver plan to access the tags addon.

Upon activation, you need to visit Envira Gallery » Settings page to enter your license key. You can get this information from your account on Envira Gallery website.

Add Envira Gallery license key

Next, you need to install the tags addon. Head over to Envira Gallery » Addons page and locate the tags addon.

Installing tags addon

Click on the install button and Envira Gallery will fetch and install the addon for you. You will still need to click on the Activate button to start using the addon.

Activate addon

Now you are ready to create your filterable portfolio.

Head over to Envira Gallery » Add New page to create your first gallery.

Upload your photographs

Click on ‘Select files from your computer’ button to upload your photos. You can also click on ‘Select files from other sources’ button to select files from WordPress media library.

Envira will now upload and insert files into your gallery. Once it’s done, you can scroll down to see your images.

Edit an image in your gallery

Now you need to click on the pencil icon to edit an image. This will bring up a popup where you can add the tags and other metadata to your photos.

Add tags to your photos

Enter the tags you want to assign to this photo. You can add multiple tags separated by comma.

Once done, click on the save metadata button to store your tags.

Now you need to repeat the process to add tags to all images in your gallery.

After adding tags to your photos click on the tags tab on the left. This is where you can enable or disable tag-filtering for your gallery.

Enable filtering for your gallery

You need to check the box to enable tag filtering, and you will be able to see settings for this option.

You can show tags above or below the gallery, show all tags or select tags to show, and configure other display settings.

Once you are done, click on the publish button to make your gallery live.

Your portfolio gallery is now ready to be added to your site.

You can now create a post or page where you want to display your filterable portfolio. On the post editor screen, click on the ‘Add Gallery’ button.

Insert gallery into WordPress posts and pages

This will bring up a popup where you can select the gallery you just created and insert it into your WordPress post and page.

You can now update your post or page to save your changes and preview your website to see your filterable portfolio in action.

Preview of a filterable portfolio gallery

We hope this article helped you add filterable portfolio in WordPress. You may also want to see our WordPress tutorials such as how to speed up WordPress by saving images optimized for the web.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Create a Filterable Portfolio in WordPress appeared first on WPBeginner.