Connect with us

Tips & Tricks

Add a shortcode

Published

on

This is a simple one.

/**
 * Your Blog title
 *
 */
function my_blog_title() {
	$blogname = get_bloginfo('name');
    return '<span class="blog-title">' . $blogname . '</span>';
}		  	
add_shortcode('blog-title', 'my_blog_title');

Just add this to your functions.php file and then add [blog-title] in any post or page and it will return your Blog Title. :)

Continue Reading
Click to comment

You must be logged in to post a comment Login

Leave a Reply

Tips & Tricks

Echo custom fields in any category

Published

on

Here is a neat trick. Say you want to show a custom field in you post or in a certain categories post. There is a simple code you need to write in order to accomplish this:

<?php $image = get_post_meta($post->ID, "image", $single = true); ?>
<?php if($image != '') : if(in_category(7)) { echo ''; } else { ?>
<img src="<?php echo $image ?>" alt="<?php the_title(); ?>" /></a>

In the example above I am calling the variable $image and telling the server that it equals the value of “image” inside get_post_meta or “custom field” of the current post.

Then we are asking if that variable $image doesn’t equal nothing or != and if it is in the category id of 7, echo what ever is in the single quotes (which is nothing in this example), otherwise show the <img> and the value inside “image” which should be the location of the image.

Update: Thanks to Austin from PressedWords for pointing out his trick, from the comment below.

Continue Reading

Tips & Tricks

Disable caching of your site or post

Published

on

I talked about Disabling search engine on search pages in a previous post using the meta tag. Today lets go over the web bots Cached copy of your site. If you are working on builder your blog, or have a temporary site up, use the following code:

<meta name="robots" content="noarchive">

This will tell any bot to follow your site, index it, but prevents a cached copy of this page from being available in the search results.

Continue Reading

Tips & Tricks

Disable search engine on search pages

Published

on

A good idea when trying to get the most out of your blog is usging the meta tag to tell the web bots to search & index your site. But for good SEO you should apply this code in your header.php file of your WordPress blog.

<?php if(is_search()) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php }?>

This will keep your site from getting a hit from bots over duplicate entries. 🙂

Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Adam Mosseri Net Worth: How Rich is the Entrepreneur Actually?

Adam Mosseri Net Worth: How Rich is the Entrepreneur Actually?

Adam Mosseri is an American entrepreneur. He currently serves as the head of Instagram. Mosseri previously served as an executive at Facebook, where he is recognized for establishing the platform’s News Feed. As of 2019, Adam Mosseri net worth is estimated to be $120 million. Adam was born on January 23, 1983, in Chappaqua, New […]

Josh Groban Net Worth

Josh Groban Net Worth

Joshua Groban Joshua Winslow Groban is an American songwriter, record producer, actor, and singer. Groban was born on February 27, 1981, in LA, California. Both his parents were artistically inclined and instilled the love of music and theater in their children. Melinda, his mother was an interior designer and an artist while Joshua inherited the […]

Asian Doll Net Worth: 5 Interesting Facts To Know About Her

Asian Doll Net Worth: 5 Interesting Facts To Know About Her

Misharron Jamesha Allen, who is better known by her stage name as Asian Doll or Asian Da Brat, is a young American rapper. She is the first female artist to be signed to Gucci Mane’s label called 1017 Records. Here are some interesting facts about Asian Doll including her net worth, personal life, career and […]

Alex Honnold Net Worth: 5 Interesting Facts You Should Know

Alex Honnold Net Worth: 5 Interesting Facts You Should Know

Alex Honnold is an American rock climber who has made a name for himself through his free solo climbs. He famously became the first ever person to free solo around El Capitan in Yosemite National Park. Here are some interesting facts about Alex Honnold including his net worth, career, personal life and many more. 1. Alex Honnold net […]

Trending