YPSA Webmaster's Blog

Skip to content Skip to sidebar
  • WordPress tutorial for beginner

    What is WordPress

    WordPress is a free and open source blogging tool and a dynamic content management system (CMS). It has many features including a plug-in architecture and a template system. WordPress is currently the most popular CMS in use on the Internet.

    It was first released on May 27, 2003, by founders Matt Mullenweg and Mike Little.  As of December 2011, version 3.0 had been downloaded over 65 million times.

    WordPress software allows anyone to create and edit new web pages and blog “posts” using only a web browser. No knowledge of HTML or other code is required. The WordPress editing interface is very easy to use. It works a lot like simple word-processing software. And, the site administrator can grant various levels of access to others, allowing them to contribute to the website/blog. Because the interface is web-based, creating and editing pages can be done from anywhere with an Internet connection.

    Continue reading…

  • How to add custom image size for wordpress post thumbnail

    Post thumbnail

    The default image sizes of WordPress are “thumbnail” (150px x 150px max ), “medium” (300px x300px max ), “large” (640px x 640px max ) and “full” (the original size of the image you uploaded). These image sizes can be configured in the WordPress Administration Media panel under Settings > Media.

    As a theme developer, you may need custom image size for your layout, for example, you may need a featured image for your post thumbnail with specific size that you want to place with every post.  if you want to add custom image size and show it in WordPress uploader, you need to register new image size using function.

     

    // add image size in function.php
    
    if ( function_exists( 'add_image_size' ) ) {
    
    add_image_size( 'featured-image', 620, 280, true); //(Image will be cropped)
    
    }
    
    add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' );
    
    function custom_image_sizes_choose( $sizes ) {
    
    $custom_sizes = array(
    
    'featured-image' => 'Featured Image'
    
    );
    
    return array_merge( $sizes, $custom_sizes );
    
    }
    
  • How to add your profile picture next to all comments in all blog posts using Gravatar

    Featured image

    When you read and comment on blogs, you see there are some default icons (commonly on a gray background a white guy) and some profile pictures are shown next to the commenter’s name. This is called Avatar. Commenter doesn’t need to upload any profile picture on each blog. Blog owners do not allow uploading picture for the unregistered users.  Question is how this is possible to show profile photo with comments as a guest user or simple visitor?

    Yes, it is possible because of Gravatar. Gravatar.com is an awesome neat website that allows you to host an avatar and use it all over the web.

    Gravatar is linked to the email address. Retrieve the avatar for a user who provided a user ID or email address. Most commonly used in the comments section.

    Your Gravatar is an image that follows you from site to site appearing beside your name when you do things like comment or post on a blog. Avatars help identify your posts on blogs and web forums.

    Continue reading…

  • Truncate WordPress Post Titles with PHP

    First open your index.php or the file location where you want to truncate the title. Then paste the following code to replace your the_title tag.

    <?php
    $thetitle = $post->post_title; /* or you can use get_the_title() */
    $getlength = strlen($thetitle);
    $thelength = 25;
    echo substr($thetitle, 0, $thelength);
    if ($getlength > $thelength) echo "...";
    ?>