Ok, here it is! The second part of Amazing WordPress hacks article, hope you'll enjoy this one as you did the part one where we have learned how to forward section pages, Grab the textual content of a Post, Load a stylesheet with dynamic values dependent on the Page view, set Post Expiration time and date etc.
And now we will see how to set Post Expiration time and date in another way, Secure your wp-includes folder and how to make WordPress Static HTML Template. There's going to be some more interesting WordPress articles so stay tuned!
WordPress post expiration code (option two)
*** enter a custom field with the key "expiration" and set the value in the format "2007/01/01" *** ***PUT THIS INSIDE THE LOOP, FIRST THING*** <?php //to check against expiration date; $currentdate = date("Ymd"); $expirationdate = get_post_custom_values('expiration'); if (is_null($expirationdate)) { $expirestring = '30005050'; //MAKE UN-EXPIRING POSTS ALWAYS SHOW UP; } else { if (is_array($expirationdate)) { $expirestringarray = implode($expirationdate); } $expirestring = str_replace("/","",$expirestringarray); } //else if ( $expirestring > $currentdate ) { ?> ***THEN PUT THE FOLLOWING LINE AT THE VERY END OF THE LOOP*** <?php } //end if for expiration; ?>
Secure your wp-includes folder
Order Allow,Deny
Deny from all
<Files ~ ".(css|jpe?g|png|gif|js|swf)$">
Allow from all
WordPress Static HTML Template
<?php unset($_SERVER['PATH_INFO']); //Include current WordPress Theme Header etc. // Change the path if wordpress isn't in the webserver root directory require($_SERVER['DOCUMENT_ROOT'] . '/wp-blog-header.php'); //Check if we're wrapping the WP Theme //Get Theme settings. $themes = get_themes(); $current_theme = get_current_theme(); $current_template_dir = $themes[$current_theme]['Template Dir']; $current_stylesheet_dir = $themes[$current_theme]['Stylesheet Dir']; //Include the WP Header get_header(); /* Your static HTML goes after here */ ?> <?php get_sidebar(); get_footer(); ?>
Have some feedback? Leave a comment



Amazing, thanks a lot!
very nice, but i liked the frist part more heh
Pingback: Amaizing WordPress hacks part 1 | StylizedWeb.com
Awesome! thanks a lot
Pingback: Amaizing WordPress hacks part 2
i have to agree with Kyle, this is usefull but first part was better :O
very cool!
Pingback: Rss VURSAKnoktacom » Blog Arşivi » Links for 2008-07-14 [del.icio.us]
Greate, I’ve added it to here
http://acomment.net/table-of-contents-of-wordpress-tutorials-helps-tips-and-tricks/4
Pingback: links for 2008-07-16 | הבלוג של אח"י דקר
Pingback: Table Of Contents Of Wordpress Tutorials, Helps, Tips and Tricks by aComment.net
Is the “Amaizing” spelling mistake intentional ?
Rooney,
damn, yea it way a mistake, it’s corrected now, thanks
Pingback: Best of July, 2008: This Month in Web Design | Vandelay Website Design
Pingback: The Giant List of Wordpress Hacks
Pingback: Websites you Shouldn´t have missed in JULY 2008
Pingback: S A N D E E P [ I N D I A N I C ] » Blog Archive » Websites you Shouldn´t have missed in JULY 2008
Pingback: Websites you Shouldn´t have missed in JULY 2008 | POLPDESIGN
Great Article. Been trying to integrate more static pages in my design.
wery cool
Pingback: Package of the most cool and useful websites of this month | Design it
Pingback: links for 2008-07-14 | the markfr ditherings
sweet, thanks.
Pingback: Table Of Contents Of Wordpress Tutorials, Helps, Tips and Tricks | DevWebPro
Enjoyed the first article of this series, like this one just as much, thanks for the research.
I think they really went beyond on this article. Keep up the great work!
Thanks for another great post. Keep it up!
haha i hate so many of the originals of songs you mix, but all the one’s you do are just soo tight
First-class story indeed. My boss has been seeking for this tips.
Most of whatever you claim is astonishingly accurate and that makes me wonder why I hadn’t looked at this with this light previously. This piece truly did turn the light on for me personally as far as this specific issue goes. Nonetheless at this time there is one position I am not too cozy with and while I make an effort to reconcile that with the main theme of the issue, allow me observe what the rest of the subscribers have to point out.Well done.
hack? not good
Enjoyed the first article of this series, like this one just as much, thanks for the research.
That it is actually a nice useful bit of details. Therefore i’m thankful that you just shared this very helpful info with us. Make sure you keep informed this way. Thanks for sharing.
Let me amend my above stetemant to read, “Notes on Looking supports culture and people who make things happen. Without dogged pursuit by lovers and hard working souls, culture eludes us. Notes is dedicated to those people who kick butt for high culture.