Results 1 to 9 of 9
Threaded View
-
2nd Jul 2012, 05:45 PM #1OPMember
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 );
Code:$s_y = 0; //floor( ($orig_h - $crop_h) / 2 );
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; ?>
--------------------------------------------------------------------------------------------------
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>'; }
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
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Help, With Wordpress post shortcodes
By Z_UpLoAdEr in forum Technical Help Desk SupportReplies: 26Last Post: 31st Aug 2012, 11:30 AM -
The 10 Top SEO Tips
By halala4832 in forum Whitehat SEOReplies: 6Last Post: 20th Jul 2012, 11:07 AM -
Wordpress Tips
By Cactus in forum Webmaster DiscussionReplies: 10Last Post: 5th Aug 2010, 01:09 PM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...