Activity Stream
48,167 MEMBERS
6819 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 9 of 9
  1.     
    #1
    Member

    Thumbs up Wordpress Tips and Shortcodes

    In this thread I will post some Wordpress shortcodes that will help you in websites development.

    This thread will be always updated, so keep it bookmarked!

    How to change post thumbnail crop position in wordpress:
    - Open media.php file under wp-includes folder.
    - Find the function named “image_resize_dimensions” (Around line 309). Unfortunately this function is not pluggable and doesn’t use any hooks so we will edit it directly. Find the lines:

    Code: 
    $s_x = floor( ($orig_w - $crop_w) / 2 );
    $s_y = floor( ($orig_h - $crop_h) / 2 );
    Change the second line to

    Code: 
    $s_y = 0; //floor( ($orig_h - $crop_h) / 2 );
    Save the file and upload it to wp-includes folder.

    Source: http://shailan.com/781/how-to-change...-in-wordpress/

    --------------------------------------------------------------------------------------------------

    How to disable text editor in Wordpress:

    Place this code in your functions.php file.

    Code: 
    add_action('init', 'my_remove_editor_from_post_type');
        function my_remove_editor_from_post_type() {
            remove_post_type_support( 'post', 'editor' );
        }
    --------------------------------------------------------------------------------------------------

    How to get Featured Image URL:

    In some cases in just want the URL of a featured image, for this, you can use this code:

    Code: 
    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
        <?php echo $image[0]; ?>
    <?php endif; ?>
    Remember to change the "single-post-thumbnail" to the size you want. You can use: full, medium or thumbnail.

    --------------------------------------------------------------------------------------------------

    Removing trash from <head>:

    By default, Wordpress add a lot of code inside your <head> that probably you will never use. To remove it, place this code inside your functions.php:

    Code: 
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wp_generator');
    remove_action('wp_head', 'feed_links', 2);
    remove_action('wp_head', 'index_rel_link');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'feed_links_extra', 3);
    remove_action('wp_head', 'start_post_rel_link', 10, 0);
    remove_action('wp_head', 'parent_post_rel_link', 10, 0);
    remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
    --------------------------------------------------------------------------------------------------

    Shortcode for YouTube videos:

    Place this code on your functions.php.

    Code: 
    add_shortcode( 'youtube', 'youtube' );
    function youtube( $atts, $content = null ) {
        return '<p itemprop="video"><iframe width="640" height="350" src="http://www.youtube.com/embed/'.$content.'?theme=light&autohide=1&showinfo=0;wmode=opaque;border=none;iv_load_policy=1" frameborder="0" allowfullscreen></iframe></p>';
    }
    Usage:
    Code: 
    [ youtube]VIDEOID[/youtube]
    bjskid Reviewed by bjskid on . Wordpress Tips and Shortcodes In this thread I will post some Wordpress shortcodes that will help you in websites development. This thread will be always updated, so keep it bookmarked! How to change post thumbnail crop position in wordpress: - Open media.php file under wp-includes folder. - Find the function named “image_resize_dimensions” (Around line 309). Unfortunately this function is not pluggable and doesn’t use any hooks so we will edit it directly. Find the lines: $s_x = floor( ($orig_w - $crop_w) / Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    piplay.me
    good, thanks

  4.     
    #3
    Member
    Website's:
    ihide.info
    thanks for the tips
    KWWH has turned gay. I will not return until Phamous is demoted.

  5.     
    #4
    Member
    New tips added today! If anyone have doubts, feel free to ask!

  6.     
    #5
    Respected Member
    looking for more
    Can you sort out the problem with Facebook javascript problem with the plugins ?
    That is, i cant use Facebook like + share + like box at the same time.

  7.     
    #6
    Member
    hello, Nice thread

    i have some, here is one :

    Add Google+ button to your posts automatically :


    Simply paste the code below into your functions.php file. Once you saved the file, the Google+ button will be automatically displayed below your posts.

    Code: 
    add_filter('the_content', 'wpr_google_plusone');
    function wpr_google_plusone($content) {
        $content = $content.'<div class="plusone"><g:plusone  size="tall"  href="'.get_permalink().'"></g:plusone></div>';
        return $content;
    }
    add_action ('wp_enqueue_scripts','wpr_google_plusone_script');
    function wpr_google_plusone_script() {
        wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null);
    }
    ------------------------------------------------

    but am looking for a code that would add a prefix to all the links in my postes, any code or a plugin ?

  8.     
    #7
    Member
    Website's:
    anadesigns.net
    Here's another popular one. Remove unnecessary links from header by sticking this in functions.php:


    Code: 
    /* remove clutter from head */
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wp_generator');
    remove_action('wp_head', 'feed_links', 2);
    remove_action('wp_head', 'index_rel_link');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'feed_links_extra', 3);
    remove_action('wp_head', 'start_post_rel_link', 10, 0);
    remove_action('wp_head', 'parent_post_rel_link', 10, 0);
    remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);

  9.     
    #8
    Member
    Quote Originally Posted by Froomple View Post
    looking for more
    Can you sort out the problem with Facebook javascript problem with the plugins ?
    That is, i cant use Facebook like + share + like box at the same time.
    This is not a Wordpress issue. Could you please provide a link to check this problem?

    ---------- Post added at 03:20 PM ---------- Previous post was at 03:20 PM ----------

    Quote Originally Posted by Froomple View Post
    looking for more
    Can you sort out the problem with Facebook javascript problem with the plugins ?
    That is, i cant use Facebook like + share + like box at the same time.
    Quote Originally Posted by anahosting View Post
    Here's another popular one. Remove unnecessary links from header by sticking this in functions.php:


    Code: 
    /* remove clutter from head */
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wp_generator');
    remove_action('wp_head', 'feed_links', 2);
    remove_action('wp_head', 'index_rel_link');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'feed_links_extra', 3);
    remove_action('wp_head', 'start_post_rel_link', 10, 0);
    remove_action('wp_head', 'parent_post_rel_link', 10, 0);
    remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
    Awesome tip! I've added to the original post.

  10.     
    #9
    Member
    New function added: shortcode for YouTube videos.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help, With Wordpress post shortcodes
    By Z_UpLoAdEr in forum Technical Help Desk Support
    Replies: 26
    Last Post: 31st Aug 2012, 11:30 AM
  2. The 10 Top SEO Tips
    By halala4832 in forum Whitehat SEO
    Replies: 6
    Last Post: 20th Jul 2012, 11:07 AM
  3. Wordpress Tips
    By Cactus in forum Webmaster Discussion
    Replies: 10
    Last Post: 5th Aug 2010, 01:09 PM

Tags for this Thread

BE SOCIAL