is_home() || is_front_page() not working ! [solved]

There are some situations when the WP conditional tags doesn’t work. Be it any reason like say: Multiple WordPress loops, faulty use of query_posts(…) or issue in the code itself. Basically this problem occurs when there is a change in the main query by the use of query_posts(). Fortunately WordPress always keeps the original, unaltered query intact. So, to get back that where all the conditional tags works we have to use the wp_reset_query().

Just place this function call wp_reset_query() before the conditional tag to solve this issue of WordPress’s is_home() || is_front_page() is not working.

Sample Code:
<?php wp_reset_query(); ?>
<?php if(is_home() || is_front_page()): ?>
     <! Do the things here... >
<?php else: ?>
     <! Else part goes here...  >
<?php endif;  ?>

 

Another WordPress threat, 100,000+ WordPress Websites infected by SoakSoak Malware

WordPress users are now facing another threat from a malware attack, named SoakSoak. Google has blacklisted over 11,000 domains with this latest malware campaign from SoakSoak.ru.

According to Security Firm Sucuri, who is actively investigating the vector of malware, already 100’s of thousands of WordPress specific websites have been infected with this malware. Though they are not sure of the exact vector, but their preliminary analysis shows its correlation with the Revslider vulnerability which was reported a few months back. Also, they have mentioned specifically, that this campaign does not appear to be specifically targeted towards WordPress only, the victims seem to be blogs relying on its frame work. So the fact that most of its victims are WordPress websites, may just be a coincidence.

Once your website is infected with this malware, you might experience irregular website behaviour including redirects to SoakSoak.ru webpages. You may also, end up downloading malicious files onto your computer systems automatically without any knowledge.

SoakSoak malware modifies the file located at wp-includes/template-loader.php which causes wp-includes/js/swobject.js to be loaded on every page view on the website and this “swobject.js” file includes a malicious java encoded script malware.

Security Firm Sucuri, has provided a free SiteCheck scanner for scanning malware on your websites. So, if you have websites in wordpress, and worried about the potential risk you can always, visit Sucuri website and scan for any malware.

Sucuri Security