Connect with us

Tips & Tricks

Display custom url if comment authors url is blank

Published

on

Here is a nifty trick for your comments.php template. If someone comes to your site and leaves a comment but doesn’t leave a url back to there site, the default link that is shown in place of the php code comment_author_url is the current page link.

That might not look good. So, here is a little trick that I just implemented into my site. Besides installing the twittar plugin and pulling Twitter avatars I wanted to use the image itself for the authors url like. But if the author doesn’t have a Twitter avatar or a Gravatar it will display a default Gravatar that I set. If the default Gravatar is shown, usually the author will not leave a url link.

I would like to link the image to Gravatar.com so that they can get an image attached to their email address. So.. here is the code:

<?php if($comment->comment_author_url != "") { ?>
<a href="<?php comment_author_url(); ?>"><?php gravatar(); ?></a>
<?php } else { ?>
<a href="http://gravatar.com" title="Get a Gravatar today!"><?php gravatar(); ?></a>
<?php } ?>
Continue Reading
3 Comments

3 Comments

  1. Pingback: Weekend Links - Jan 16, 2009 | OMNINOGGIN

  2. Pingback: Weekend Roundup #32 » JaypeeOnline // Blogging News & Reviews

  3. arcade games

    March 11, 2009 at 3:13 pm

    very nice idea, it could be an advertising slot.

You must be logged in to post a comment Login

Leave a Reply

Tips & Tricks

Remove the title attribute using jQuery

Published

on

In WordPress, when you use wp_page_menu your anchor attribute’s usually carry a title with the same name. I’m not sure if it’s correct to do this, but it bother me when I hover over a page menu navigation link and I get a hover of the title.

So on my site I used jQuery to remove the title:

$("#nav a").removeAttr("title");

Pretty simple huh?

Continue Reading

Tips & Tricks

How to: Open external links in a new window

Published

on

Over the weekend, I attended WordCamp Denver, and I was asked by John Hawkins how to force links to open in a new tab with out editing the source code. So, today lets learn a simple jQuery trick to open all external links in your site in a new tab or window. We are going to make sure you have jQuery active on your site, you can do this easily in WordPress, since it’s bundled with the latest installations. Use this code in your header: <?php wp_enqueue_script('jquery'); ?> then, below the wp_head add the following:

<script type="text/javacript">
var $j = jQuery.noConflict();

$j(document).ready(function() {
//external attribute
    $j("a:not([@href*=http://YOURSITE.com/])").not("[href^=#]")
        .addClass("external")
        .attr({ target: "_blank" });
    }
);
</script>

That’s it, just make sure you change the http://YOURSITE.com to your website.

Update

If you like you can remove the var $j = and replace all $j with simply just $

 

Continue Reading

Themes

Fixing plugins not compatible with hybrid 0.4.2

Published

on

Hey everyone, as you may have noticed I have a running on the site. While everything almost everything moved over smoothly, there was an issue with how my parent theme striped text in typography. This caused some plugins, like cformsII to not be allowed to print to the screen. Justin had helped to find a fix to filter the hybrid_typography function.

Originally this function filtered out and changed some text that would not validate as XHTML. This had to be removed by running a new function in the child theme’s function.php file.

add_action('init', 'remove_typography');

function remove_typography() {
	remove_filter('the_content', 'hybrid_typography', 11);
}
Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Joey Chestnut Net Worth: How Rich is the Competitive Eater Actually?

Joey Chestnut Net Worth: How Rich is the Competitive Eater Actually?

Joseph Christian Chestnut is an American competitive eater. But, he isn’t just any competitive eater, he is currently ranked as number one in this unique sport according to Major League Eating. As of 2019, Joey Chestnut net worth is estimated to be $2 million. Chestnut was born on November 25, 1983, in Vallejo, California. Having grown […]

Shroud Net Worth: How Rich is Streamer Mike Grzesiek Actually?

Shroud Net Worth: How Rich is Streamer Mike Grzesiek Actually?

Michael Grzesiek, who is better known as Shroud, is a video game streamer and a former pro-Counter-Strike: Global Offensive (CS:GO) player. He was one of the most popular streamers on the live streaming platform Twitch but recently made a bold move to join Microsoft owned new streaming platform named Mixer. As of 2019, Shroud net […]

Lil Mosey Net Worth: How Much is the Rapper Worth in 2019?

Lil Mosey Net Worth: How Much is the Rapper Worth in 2019?

Lathan Moses Echols, who is better known by his stage name as Lil Mosey is an American rapper and songwriter. He is best known for his hit song called “Noticed” that managed to peak at the number 80 in the Billboard Hot 100 charts. In 2019, Lil Mosey was included in the XXL Freshman Class […]

Marie Yovanovitch Net Worth: How Rich is Marie Yovanovitch Actually?

Marie Yovanovitch Net Worth: How Rich is Marie Yovanovitch Actually?

Marie Yovanovitch is an American diplomat who served in a variety of positions at the State Department. She worked as the Ambassador to Ukraine from 2016 to 2019. As of Marie Yovanovitch net worth is estimated to be $2 million based on her government salary only. Yovanovitch was born in 1958 in Quebec, Canada to […]

Trending