Make the “read more” link to the post
Dec03

Make the “read more” link to the post

Place this in a theme’s functions.php to make the “read more” link to the post function new_excerpt_more( $more ) { return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">Read More</a>'; } add_filter( 'excerpt_more', 'new_excerpt_more' );

Read More
Remove […] string using Filters
Dec03

Remove […] string using Filters

In WordPress version 2.9, a new filter was added to make changing the […] string in the excerpt. Do not use both of these methods in the same WordPress installation. Use the one appropriate for your WordPress version. For versions 2.9 and higher of WordPress By default, excerpt more string at the end is set to ‘[…]’. To change excerpt more string using excerpt_more filter, add the following code to functions.php file in your theme: function new_excerpt_more( $more ) { return '[.....]'; } add_filter('excerpt_more', 'new_excerpt_more'); For versions 2.8.x and Older function new_excerpt_more( $excerpt ) { return str_replace( '[...]', '...', $excerpt ); } add_filter( 'wp_trim_excerpt', 'new_excerpt_more'...

Read More
Control Excerpt Length using Filters
Dec03

Control Excerpt Length using Filters

By default, excerpt length is set to 55 words. To change excerpt length to 20 words using excerpt_length filter, add the following code to functions.php file in your theme: function custom_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Read More
Shortcode for display the WordPress theme path using php function
Sep18

Shortcode for display the WordPress theme path using php function

Shortcodes are easy and useful for wordpress. Shortcodes helps in so many things like we can use one instead of retyping a lot of content. In web developing time we can minimize the lot of time. I use this often when developing themes for clients so that when I put an image inside the themes image folder during development, when the theme is later placed on the client’s server, the image path still works without me having to change it. Just add following Code to the functions.php file in your current WordPress theme. /* * Get stylesheet directory for images */ function themepath_shortcode() { return get_bloginfo('stylesheet_directory'); } add_shortcode('theme_path', 'themepath_shortcode'); Now you can just type [theme_path] shortcode in wordpress editor. Place this shortcode inside an image src or other places as...

Read More
Links Manager section is not visible in Word Press Admin
Jul17

Links Manager section is not visible in Word Press Admin

As of Version 3.5, the Links Manger and blogroll are hidden for new installs and any existing WordPress installs that do not have any links. If you are upgrading from a previous version of WordPress with any active links, the Links Manager will continue to function as normal. If you would like to restore the Links panel to your install you may download and install the Links Manager plugin. This page is still relevant for any user with an existing Links Manager or with the plugin installed. WordPress allows you to store a set of external links, also known as your blogroll. These links can be put into categories, imported, exported, added, deleted, and edited. The link categories can also be added, deleted, and edited. This article describes how to do all of the above, using the Links section of the WordPress Administration...

Read More

Fetch WP Post title and excerpt content from specific category

To fetch WP Post title and excerpt content from specific category using below code <ul> <?php query_posts('cat=2&showposts=100'); ?> <?php while (have_posts()) : the_post(); ?> <li> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?> <br> <?php the_excerpt(); ?> </a> </li> <?php endwhile; ?>...

Read More
'