cedmax.net

pink is the new black

5 popular CSS Frameworks
tips and advice on web standards development
12 Principles For Keeping Your Code Clean
Css Sticky Footer

wordpress cheat sheet
wordpress sample content for theme development
setting opacity to ie8 (and other filters as well)
25 tips to improve your jQuery

I was trying to integrate wordpress and sweetcron to have a “lifestream” section on my wordpress based website.

First of all I created a folder named sweet (you can use everything you like)
then I tryed to integrate wordpress dynamic data (header, footer, sidebar and style) in sweetcron template.

that was pretty easy: I added this line of code:

1
require("../wp-blog-header.php");

on the top of index.php in sweetcron root

Now I was able to use every template tag I needed (as well as widgets and everything else in use in wordpress) in sweetcron theme pages..

The problem was that wordpress was returning a 404 error in http headers and page title was "Page not Found"

So i created a wordpress page named Life Stream with sweet as slug.

Sweetcron homepage was safe but every internal sweetcron link (for example this) had the same 404 problem.

so I wrote this really tiny plugin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/*
Plugin Name: Sweetcron integration
Plugin URI: http://cedmax.net
Version: 0.1
Description: Manage Sweetcron wordpress integration 
Author: cedmax
*/
 
 
function sweetcheck() {
	$pagename='sweet';
	$isStream =  substr_count(str_replace($_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']).'/', '/'.$pagename.'/');
	if ($isStream>0) query_posts('pagename='.$pagename);
}
 
 
add_action('init', 'sweetcheck');
?>

change sweet with yoursweetcroninstallationfolder and everything should be fine.

edit I had to remove my sweetcron installation: some problems with some of the feeds I was importing and no time to fix it, but the integration is still working

What I’m Doing

Something About Me

Social Links

Something About Friends

Copyright © 2009 cedmax.net.

Powered by Wordpress. Theme by WordpressCenter.com.