Connect with us

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
7 Comments

7 Comments

  1. Bryan

    March 11, 2009 at 9:32 pm

    Hey, yeah, that’s really simple! Right now I’m doing…

    $clean_pages = wp_list_pages(‘title_li=&&echo=0’);
    $clean_pages = preg_replace(‘/title=\”(.*?)\”/’,”,$clean_pages);
    echo $clean_pages;

    • Frosty

      March 12, 2009 at 12:55 pm

      Yes, a lot easier, but it won’t work on any browser that has javascript disabled.

  2. andy

    March 21, 2009 at 11:25 am

    correct me if i am wrong please….do i just put this code in my head section:

    $(“#div_id”).removeAttr(“title”);

    and that should remove the title attribute from displaying when I hover over any item within the #div_id ?

    Note: it is not an a tag I am trying to remove the title attribute from, but rather a div tag.

    • Austin

      March 21, 2009 at 2:24 pm

      Yes, the removeAttr should remove any title attribute if there is one, as long as javascript is enabled.

    • Unibands

      October 29, 2009 at 5:08 am

      Yes, but you of course need the jQuery library too. And you put this like so in your tags.

      //

  3. Unibands

    October 29, 2009 at 5:12 am

    Seems like code etc doesn’t show up in the comments.

  4. Pingback: Remove WordPress Title Attribute | ClayCazier.com

You must be logged in to post a comment Login

Leave a Reply

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

Plugins

Add the twittar plugin for WordPress w/ comment threading

Published

on

I talked about the Twittar plugin in a previous post. But learned that the read me text file was only useful for installing the necessary php code into WordPress themes that don’t have comment threading enabled.

Since most new themes past version 2.7, pull the comments section from functions.php file, that is where you have to edit the avatars in order to show the twittar settings.

First open you functions.php, and look for a line of code that says:

function custom_comment()

This is where your new comments are pulled from when you have the threaded comments enabled.

Now just find <?php echo get_avatar( $comment, $args['avatar_size'] ); ?> & replace with <?php twittar(70, "", "", "avatar avatar-70 photo", 1, "R"); ?>. Keep in mind that you will need to edit the Twittar setting to fit your site.

Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

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 […]

Margaret Josephs Net Worth: How Rich is the RHONJ Star?

Margaret Josephs Net Worth: How Rich is the RHONJ Star?

Margaret Katona Josephs is an American fashion designer and entrepreneur who founded the lifestyle brand Macbeth Collection. She is also one of the cast members of the popular reality series The Real Housewives of New Jersey. As of 2023, Margaret Josephs’s net worth is estimated to be $60 million. Josephs was born on April 9, […]

Ben Zobrist Net Worth: 4 Interesting Facts You Should Know

Ben Zobrist Net Worth: 4 Interesting Facts You Should Know

Ben Zobrist is an American professional baseball second baseman and outfielder who currently plays for the Chicago Cubs of Major League Baseball. Early Life Ben was born on May 26, 1981, in Eureka, Illinois to Cynthia and Tom Zobrist. He started playing baseball when he was eight years old. He graduated from Eureka High School […]

Angel Strawbridge Net Worth: How Rich is Angel Strawbridge Actually?

Angel Strawbridge Net Worth: How Rich is Angel Strawbridge Actually?

Angel Strawbridge is a designer, author who appears in the popular TV series called Escape to the Chateau along with her husband Dick Strawbridge where they work on renovating a massive Chateau they had bought in France after moving from England. Angel Strawbridge net worth is under review and is not available at the moment. […]

Trending