Regex to remove URLs inside WordPress Post

There were time where I have to take down a web apps and making thousands of URL reference broken. So the only way to fix that is to remove all those links. Thankfully wordpress has a vast variety of regex search and replace.

I am using Search Regex plugins (You can find it on WP Plugins directory)

/<a href="http:\/\/www\.domain\.com\/subfolder\/[^>]*>([\s\S]*?)<\/a>/

Refer to the screenshot below.

Screen Shot 2016-06-20 at 2.16.49 PM

Placing an ad or content block on single post after certain paragraph – WordPress Tip

If you ever have to show an ad or content block on a single post page – under a certain paragraph (eg. right after the first paragraph) – you can use the code below by replacing the_content.

<?php
$ad_placement_p = 2;
$content = apply_filters('the_content', $post->post_content);if(substr_count($content, '<p>') > $ad_placement_p)
{
	$contents = explode("</p>", $content);
	$p_count = 1;
	foreach($contents as $content)
	{
		echo $content;
 
		if($p_count == $ad_placement_p)
		{
		?>
               Your Ad Code
		<?php
		}
		echo "</p>";
		$p_count++;
	}
}
?>

The way it works is by using < p > as marker of position. Feel free to change $ad_placement_p value to assign locations of this content/ad block.

How to setup pptp VPN server on Linux [Tutorial]

I’m moving to Japan very soon and remembered that Google Voice won’t be working once I step onto Land of the Rising Sun. So I figured I should setup a VPN tunneling for me to access services that is available only in the US. Setting up PPTPD is fairly easy and straight forward. I’m using SoftLayer BYOC (Build Your Own Cloud) which cost $70/month for 2TB bandwidth (inbound bandwidth is free – unlike Rackspace cloud).

Read More

Finding the right CDN for SlashGear

It has been interesting and educational two months; I had the chance to use several major CDN services on SlashGear. Choosing the right CDN is a matter of pricing/budget, delivery technology or features and POP availability. The CDN vendors I had the opportunity to try are MaxCDN, InterNAP, Highwinds, Akamai, and EdgeCast.

Read More

SlashGear is on WordPress Showcase

I’m honored that SlashGear was added to WordPress showcase for our unique implementation of WordPress & BBPress.

Quoted from WordPress Showcase

Why it’s in the Showcase: SlashGear is a major gadget and technology blog that receives millions of readers per month and uses WordPress to power its entire site, including main site, bbPress-powered forums, and video site. All three sites have integrated user tables and login session sharing.

Does Media Really have an effect on elections?

There’s what they call freedom of the press which is a right given by the government to the citizens for free public press. But is this right being abused these days? Are media using this right to plot against the government? Do media really have an effect on the elections? I would say yes. The citizen are somewhat being manipulated by media.

Read More

Traditional newspapers are disappearing rapidly

It is hardly a surprise anymore when another newspaper announces that they will no longer exist in print format. Instead these newspapers are heading online and not a whole lot of people seem to be upset about it. One of the biggest reasons for the new trend is related to advertising.

Read More

SlashGear Team at CES 2009

CES 2009 was not as exciting as it was in the previous years I’ve attended; but we still had fun covering the show. Almost everyone from SlashGear’s core staff was in Vegas. Here are some of SlashGear team photos.

AndroidCommunity Launch Party – Oct 18th 2008

It was a fun weekend and our Android Community party had a pretty good turnout in Dallas. Got to meet some cool people at the party, there were Jason from Big In Japan (ShopSavy), The SoftLayer guys (love them), Travis from Dallas Morning News, and many others. While we only have one G1 phone to pass around, we have plenty of booze to keep everyone happy 🙂

I want to thank our premier sponsors for their support – Business Asset Consultant, SmartPhone Experts, and Sandisk. We gave away a Plantronics headset, a Jabra Headset, a T-Mobile Sidekick, a WoWee Robot, and a 16GB SanDisk MicroSD. Overall, the party was a success. So if you are in DFW area, don’t miss the next one and make sure to RSVP early as we only have limited spot available.

Computer Hardware Upgrade – When is the right time?

Computers are everywhere. In fact, the life of many largely depends on computers. They send their mail on the web rather than the old time practice of sending them through snail mail. They talk to their friends through chats. Take up examinations digitally to prevent errors on checking. Life is surely easier because of them. But as much as we take advantage of these computers, we should be sensitive to their needs. Like any other machines, they also need to be upgraded from time to time to work better. We need to pave enough attention to this matter if we want to make the most out of them.

Read More