Home
Latest Scripts
Popular Scripts
Contact
Useful Links
Login
Email
Password
Forgot Password ?
New User?
Sign Up here
Categories
Ajax (6)
Asp (0)
Asp.net (0)
CSS (1)
Flash (0)
Html (16)
Javascript (12)
Jquery (3)
Liquid (Shopify) (0)
Php (15)
WordPress (13)
Xml (3)
add_theme_support
dynamic_sidebar
featured
functions
functions.php
get_permalink
get_post_meta
get_post_thumbnail_i d
image
meta
permalink
post-thumbnails
register_sidebar
sidebar
thumbnails
wp_get_attachment_ur l
featured
images
link
post
post_meta
register
thumbnail
widget
wordpress
101scripts
WordPress: Enable Featured Image In A Theme
Most themes already come with this support but if you are building one from scratch and you want to add this ability, just add this add_theme_support code to the functions.php file.
if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); }
Rating: 0
Views: 1
WordPress: Get Featured Image URL
Get the post featured image url with this code.
$feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));
Rating: 0
Views: 1
WordPress: Register a Sidebar (Widget section)
To register a sidebar for the widget area in WordPress, use this code.
register_sidebar( array( 'name' => 'Footer Widget', 'id' => 'footer-widget', 'description' => 'This Widget Show the Content in Footer Area.', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
' ) ); // To display it inside your theme use this line of code if ( !dynamic_sidebar('footer-widget') ) : endif;
Rating: 0
Views: 1
WordPress: Get Post Permalink
To get the post permalink in WordPress, use this code.
// Gives the link URL $permalink = get_permalink( $id ); // Gives the structure of the link. // You probably do not need this. $permalink = get_permalink( $id, true );
Rating: 0
Views: 2
WordPress: Get Post META
To get post meta data in WordPress, use this code.
$metaValue = get_post_meta( get_the_ID(), 'meta_key', true );
Rating: 0
Views: 3
« Prev
1
2
3
Next »