Connect with us

Tips & Tricks

Remove spaces when echoing the_title

Ever wanted to print or echo the WordPress title attribute without spaces?

Published

on

This little trick can be useful for calling custom functions and printing the title with out spaces for W3C compatibility. I used this trick in a new theme called Galleria, which will be out for public download in the coming days.

Using this comes in handy for a delicious text link:

<?php $title = get_the_title(); ?>
<a href="http://del.icio.us/post?url=<?php echo $title; ?>&amp;<?php echo str_replace(" ", "%20", $title); ?>">
Bookmark This (<?php echo $title; ?>)</a>

What I am doing is calling $title = get_the_title(); and using str_replace(" ", "%20", $title); to replace empty spaces with a %20, which is used in URL encoding empty spaces.

Alternatively you can use a dash or underscore.

Thanks to Jason Boyle for his adaption.

Tips & Tricks

Flip! A jQuery plugin

Published

on

I just came across a interesting new plugin built on the wonderful jQuery library. It’s called Flip!, head on over and check out the cool demo!

Continue Reading

Tips & Tricks

How to: Add a contact me via Skype™ button

Published

on

This little trick is really simple and easy. All you need to do is plug this line of code anywhere you would like to use the text.

<a onclick="return skypeCheck();" href="skype:austin.passy?call">Call me on Skype!</a>

That’s is, pretty simple huh? Just make sure you change skype:austin.passy to your user name!

Want a test? Well, please use the text button, as I was getting to many call’s and hangups: Call me on Skype! Message me on Skype!

Thanks to Shayne for this code!

Update:

I was reminded by Shayne that you will have to add this script into your header.php file:

<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
</script>

That way if the user doesn’t have Skype, they will be prompted to download it if they would like :).

Continue Reading

Tips & Tricks

How to: show/hide a widget in WordPress with jQuery

In a previous post I talked about how to show/hide a single div html code with a search inside. Today I’d like to show you how I implemented jQuery into my new theme.

Published

on

As seen in the current theme, I am using jQuery to animate the show/hide or as known as the css style display: none;.

Since I am using a custom child theme on my site, and have Hybrid theme as my parent, the widgets or sidebar section is different than may be in your theme. But just apply the the style’s as follows to your theme.

First make sure that your WordPress site is calling jQuery, by plugging in this code into your header.php file above the <?php wp_head(); ?> text:

<?php wp_enqueue_script('jquery'); ?>

Then anywhere above the </head >, plug this code in:

<script type="text/javascript">
function toggleWidgets() {
	$('#primary h3.widget-title').addClass('plus');

	$('#primary h3.widget-title').click(function() {
		$(this).toggleClass('plus').toggleClass('minus').next().toggle(180);
	});

}
$(document).ready(function() {
	toggleWidgets();
}
</script>

That’s it. Pretty simple huh.

So lets go over what the code does.

$('#primary h3.widget-title').addClass('plus');

This line finds all <h3> tags with the class widget-title inside the ID parameter of #primary and adds a class of plus.

Then

$('#primary h3.widget-title').click(function() {
		$(this).toggleClass('plus').toggleClass('minus').next().toggle(180);
	});

Will apply a click function. When the H3 tag is clicked it will remove the class plus and add the class minus.

Then the code that says .next will then toggle the “next” element after the <h3> title.

Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Biggie Smalls Net Worth

Biggie Smalls Net Worth

Biggie Smalls Net Worth, If he was alive today, And more information you want to know. Biggie Smalls was also called The Notorious B.I.G., and he was an American rapper and hip-hop musician. Smalls was born with the name Christopher George Latore Wallace in 1972 in Brooklyn. The artist began his career in his teens […]

Alison Hammond Net Worth: How Rich is Hammond Actually?

Alison Hammond Net Worth: How Rich is Hammond Actually?

Alison Hammond is an English television personality who is known for presenting ITV’s ‘This Morning’ as the showbiz reporter. As of 2019, Alison Hammond net worth is estimated to be $1.5 million. Hammond was born on February 5, 1979, in Birmingham, England. Her father is Nevisian and her mother is Guyanese. Before she became famous she was a […]

Alexandria Ocasio-Cortez Net Worth: 5 Facts You Need To Know

Alexandria Ocasio-Cortez Net Worth: 5 Facts You Need To Know

Alexandria Ocasio-Cortez is one of the biggest and youngest female politicians to serve in the New York Congress. A political activist, Congresswoman, and clever politician. Born to a Catholic family of Bianca and Sergio Ocasio Cortez on October 13, 1989, in New York City. A self acclaimed democratic socialist, pulled one of the biggest upset […]

Dakotaz Net Worth: How Rich is the Twitch Streamer Actually?

Dakotaz Net Worth: How Rich is the Twitch Streamer Actually?

Dakotaz’s Financial Game: Unmasking the Twitch Titan’s Net Worth Brett Hoffman, the man behind the digital sensation “Dakotaz” (or “DK” for those in the know), is not just a Twitch Streamer but also a YouTube maestro. With Fortnite as his playground, he boasts a staggering 4 million followers on Twitch. As of 2023, the treasure […]

Trending