Aug 282016
 

How to disable Adsense ads on Not Found error pages in WordPress?

This post aims at providing you with the PHP code snippet you need to use on your WordPress-powered website in order to prevent Adsense Ads from appearing on 404 error pages!

404 not found pages not eligible for Adsense Ads

404 not found pages not eligible for Adsense Ads

Google policies! It is well known that Google does not want Adsense ads to pop-up on 404’s. According to its ad placement policies, “publishers are not permitted to place ads on any non-content based pages like thank you, log in, exit or error pages.” Generally speaking, you shall not authorize or encourage the display of any Ad(s), Link(s), or Referral Button(s) on any error page. In conclusion: No Google ad may be placed on any non-content-based pages like the 404s”.

What are 404s? A 404 or Not Found error message is a HTTP standard response code to point out that the client was able to make communication with the server, but the server could not deliver what was requested. Practically it pops up when a visitor clicks on a broken link or makes a typo thus mismatching the real URL of your website page. A 404 Error Page does not have much content as the server returns a HTML page that has just the 404 response code followed by a human readable “Not Found” phrase.

Since Adsense is a contextual-based advertising network and error pages usually contain no content, then it is obvious that a regular error page almost certainly would not qualify for AdSense ads display.

Fixing the problem: Disabling Adsense on 404s!
In the following you’ll find the code you have to embed into your website/blog in order to disable Adsense on “Not found pages” and implicitly avoid getting punished by Google.

The small chunk of php code which does the great job is:

<?php if (!is_404()) { ?>
ADD HERE YOUR ADSENSE CODE
<?php } ?>

There are two options to play with the above code:
1. Via Theme’s .php files
2. Via Theme’s widgets area.

1. In the first case you just have to insert the snippet into the php files (Appearance->Editor->php files) that handle the Adsense ads (e.g. header.php, sidebar.php or single (post).php). It works nicely but it might not fit perfectly in terms of design if you use a heavily widgetized theme. If that’s the case, then you may use the second possibility:

2. Many people who monetize their blogs just simply use the “Text” (HTML) widget (Appearance->Widgets) in order to add the Adsense codes to their site. However, the above php-code alone does not take effect because a Text Widget does not really understand the php scripts, but a workaround is available: converting the text-based widget into php-executable widget and that can be simply done by inserting the following lines of code into the function.php file of your template (search for functions.php in Appearance->Editor).

add_filter(‘widget_text’,’execute_php’,100);
function execute_php($html){
if(strpos($html,”<“.”?php”)!==false){
ob_start();
eval(“?”.”>”.$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}

…and that’s it! Now the Text widget would be able to execute the php-snippet that wraps your adsense code and what you have to do is just to add the widget to the section of your website where you want adsense ads to appear (header, sidebar, footer, etc). As a result of the trick, no ads should be displayed on 404 error pages.

Save

Aug 212016
 

Another extravagant hypercar, Aston Martin Vanquish Zagato Volante, made its debut at Monterey Car Week 2016 in California these days.

zagato volante

Glamorous Vanquish Zagato Volante made debut at Pebble Beach (pic: Aston Martin)

The British car manufacturer has decided to once again repeat the success they had with Vanquish Zagato Coupe which was initially presented as a concept in May.

The open version of the model is the result of a collaboration between Aston Martin and the Italian design house Zagato, a “friendship” which began back in 1960.

Zagato Volante (see photos here) features some original LED-based rear lights that remind us of those seen on the racing supercar Aston Martin Vulcan.

The convertible, whose design is not much different from the coupe version except the roof, is powered by a 5.9 liter naturally aspirated V12 engine that generates 592 hp. The acceleration from 0-100 km/h is done in just 3.7 seconds.

The interior is lined with a very high quality leather in combination with carbon fiber inserts and anodized bronze.

The Volante roadster will be produced only in 99 units just like the coupe and the price is expected to exceed 500,000 euros per unit.

Aug 212016
 

Brazil claimed the first Olympic gold in men’s soccer tournament after beating Germany 1-1 (5-4) in penalty shootouts.

Neymar after his amazing free kick goal (capture: youtube)

Neymar after his amazing free kick goal (capture: youtube)

The joy and pride of this football win cannot be underestimated for Brazil, not only because of what happened at the World Cup but also because they’ve been chasing this Olympic title for years.

It’s the first time Brazil has won football gold at the Olympic Games, despite earning three silvers and two bronzes.
In the London 2012 final, a Brazilian side that included Neymar lost 2-1 to Mexico.

On the penultimate day of Rio 2016, it’s also a beautiful near-ending to a home.

Penalty shootouts as it happened:
Extra time is over and the score is still 1-1! Penalty shootout it is. Nobody seems to be enchanted about it.

Germany’s Ginter takes the first one. And scores! The pressure is unbearable.
Augusto shoots for Brazil. He scores! (1-1)
Stadium boos as Germany takes their second. Gnabry scores! Waverton gets both hands on the ball but fails to save it.
Marquinhos equalizes for Brazil. (2-2)
Very smart penalty by Brandt follows — Waverton dives the other way.
Rafinha for Brazil. He scores! (3-3)
Suele smashes it in for Germany. No one is bowing to the pressure here.
It’s 4-4: Luan shoots a stunner for Brazil.
SAVE! Waverton saves the German attempt! This is big. Everything is ready for Neymar to finish this off. 5-4 for Brazil!!!

Video: Brazil V Germany, 1-1 (6-5) Full Highlights and Goals, Rio Olympics Final

Aug 212016
 

A violent explosion rocked a wedding event in the city of Gaziantep in southern Turkey on Saturday, killing at least 51 people and injuring 70 others. Turkish officials talk about a terrorist attack committed by a suicide bomber.

AKP lawmaker Samil Tayyar believes Daesh was behind attack

AKP lawmaker Samil Tayyar believes Daesh was behind the coward attack

Ambulances rushed to the tragedy site, located in the Sahinbey district. Red Cross workers called for people to urgently donate blood in order to save victim’s lives.

Samil Tayyar, a lawmaker from the ruling party, AKP, said in a Twitter message that the Islamic State militants were behind the attack, not the PKK. Also Turkish Deputy Prime Minister Mehmet Simsek believes that Daesh terror network was involved in the tragic incident.

Ambulances keep racing to the scene as authorities attempt to get a handle on the carnage that has resulted from the strike.

Gaziantep is around 65 km away from the border with Syria. Two police officers lost their lives in this city last May when a suicide bomber blew himself up.


Turkey, a NATO member, has suffered lately from a series of attacks carried out by the Islamic State militants and Kurdish separatist group PKK who seek independence.

Last July, three kamikaze attackers believed to have been part of the Islamic State ranks, killed 44 people at the main airport (Ataturk) in Istanbul after detonating bombs in what was seen as the bloodiest attack in Turkey this year.

Aug 212016
 
Bugatti Chiron Officially Presented at US The Quail Auto Show Event in Pebble Beach, California

After making a lavish debut at the Geneva Motor Show last March, Bugatti Chiron hypercar has been seen at various motor show events in Monaco, Le Mans, and even the Goodwood Festival of Speed. Not many Chirons havee been seen so far in the United States of America, but these days the luxury model was […]

Aug 202016
 

Typically, when deciding to buy an exclusive super-car, most of the wealthy people on Earth, are thinking that the vehicle won’t be used every day on long distances or any type of roadway. Most likely, such bolides are driven just a little and usually “catch dust” in various collections and exhibitions. However, the general rule […]

Aug 202016
 

A violent storm hit Tampa Bay in the US state of Florida, where an amateur cameraman has been able to capture an unusual lightning bolt on his camera. Unlike the regular bolts, this one emerged as a long horizontal bright arc. The footage was posted on Facebook by Fox 13 News with the following caption: […]

Aug 192016
 
Harley-Davidson will pay $12 million to settle dispute with EPA over pollutant emissions

Harley-Davidson is willing to pay a $12 million fine after being accused that the emission level of its motorcycles is too high. The US environmental authorities slammed the legendary American company for illegally selling aftermarket equipment that enhance the power of the engine but the emissions as well, informs Reuters. The Environmental Protection Agency (EPA) […]

Aug 192016
 

A big surprise emerged from Cincinnati where the King of Clay Rafael Nadal was stunningly kicked out of the ATP World Tour Masters 1000 tournament after losing to 19-year-old Croatian tennis player Borna Coric who ranks 49 worldwide (SCROLL FOR VIDEO). The young Croatian, 33rd in the ATP rankings last year, beat the Spaniard 6-1, […]