sticky
closed
not a support questionsend your articles by email to their friends
< a href="mailto:?subject=<?php the_title(); ?>&body=<?php the_permalink() ?>" title="Send this article to a friend!">Email this< /a>
Remove widget areas
<?php add_filter( 'sidebars_widgets', 'disable_all_widgets' ); function disable_all_widgets( $sidebars_widgets ) { if ( is_home() ) $sidebars_widgets = array( false ); return $sidebars_widgets; } ?>
provide tinyurls
function getTinyUrl($url) { $tinyurl = file_get_contents("http://tinyurl.com/api-create.php?url=".$url); return $tinyurl; }
<?php $turl = getTinyUrl(get_permalink($post->ID)); echo 'Tiny Url for this post: < a href="'.$turl.'">'.$turl.'< /a>' ?>
Get parent page/post title
<?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?>
privates pages in navigation menus
< ul>
<?php wp_list_pages('depth=1&title_li=0&sort_column=menu_order'); if(current_user_can('read_private_pages')) : ?>
< li>
< a href="<?php echo get_permalink(10); ?>">For Authors only< /a>
< /li>
<?php endif; ?>
< /ul>
enlight searched text in search results
echo $title;
replaced with
<?php $title = get_the_title(); $keys= explode(" ",$s); $title = preg_replace('/('.implode('|', $keys) .')/iu', '<strong class="search-excerpt">', $title); ?>
Remove /category/ from your WordPress url
RewriteRule ^category/(.+)$ http://www.yourblog.com/$1 [R=301,L]
Embed CSS in your posts with a custom field
<?php if (is_single()) { $css = get_post_meta($post->ID, 'css', true); if (!empty($css)) { ?> <style type="text/css"> <?php echo $css; ?> <style> <?php } } ?>
insert the following code between the <head> and </head>
This topic has been closed to new replies.