Zen Cart Logo
Forums / General Questions / Adding Wordpress to Zen Cart

Adding Wordpress to Zen Cart

Locked

Views: 1,477

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
11 Nov 2007, 11:28 PM
#1
kthompson avatar

kthompson

New Zenner

Join Date:
Jul 2007
Location:
Minneapolis, MN, United States
Posts:
71
Plugin Contributions:
0

Adding Wordpress to Zen Cart

All I needed was a way to display only the post from my word press on my zencart.
I found a way without installing any mods.

All you need to do is put the following on whatever page you need to display the post on.

<?php
include('http://www.your_site.com/your_word_press/index.php');
?>

This will post the entire page into the main section of your zencart to change what appears here you need to change the wordpress theme to fit your needs. You can display post or the sideboxes as well. it all depends on your wordpress theme.

You can even add this code to your tpl_main_page.php to remove the zen sideboxes so that you actually display your wordpress page under your zen cart header.

//add page names that you wantto disable left and right columns
	$center_column_only = array('WORDPRESS PAGE'); 
	// the following IF statement can be duplicated/modified as needed to set additional flags
  	if (in_array($current_page_base,$center_column_only) ) {
    		$flag_disable_right = true;
    		$flag_disable_left = true;
  	}

EXAMPLE HERE

4 Dec 2007, 1:20 AM
#2
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Adding Wordpress to Zen Cart

interesting. You made an ez page with the blog included. Where did you put the include statement so that it only shows on that ezpage?

5 Dec 2007, 2:45 PM
#3
kthompson avatar

kthompson

New Zenner

Join Date:
Jul 2007
Location:
Minneapolis, MN, United States
Posts:
71
Plugin Contributions:
0

Re: Adding Wordpress to Zen Cart

All you do is put it where you want the blog to appear. simply make your ez page and put the include statement in it. There is one modification you need to make first.

Check out this thread to see how to allow php includes inside your ez pages
[
http://www.zen-cart.com/forum/showthread.php?t=37252](http://www.zen-cart.com/forum/showthread.php?t=37252)

If you want it to appear elsewhere like on the main page simple put the code in the define_main_page.

5 Dec 2007, 3:31 PM
#4
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Adding Wordpress to Zen Cart

Thanks for expanding my knowledge!!

9 Dec 2007, 4:02 PM
#5
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Adding Wordpress to Zen Cart

I like this and have tested it on my test site. But, I'm running into two problems. First, the Wordpress blog is waaaay too wide and I can't change the CSS without upgrading so for that problem I will just have to turn off the Zen Cart sideboxes.

The second problem is that when readers click on links in the blog(especially the comments) it navigates them away from the my site and to wordpress. Any way to prevent this?

-lindasdd

9 Dec 2007, 4:45 PM
#6
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Adding Wordpress to Zen Cart

add target="_blank":

<a href="#" target="_blank">link</a>

10 Dec 2007, 7:01 PM
#7
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Adding Wordpress to Zen Cart

yellow,
I understand what you are indicating, but I'm not sure where to put it because I don't have access to adjust the "guts" of the links the blog. Is there a place to do this on the EZ-page so that it universally affects the blog links?

thanks,
lindasdd

10 Dec 2007, 8:46 PM
#8
kthompson avatar

kthompson

New Zenner

Join Date:
Jul 2007
Location:
Minneapolis, MN, United States
Posts:
71
Plugin Contributions:
0

Re: Adding Wordpress to Zen Cart

None that I know of there is a wordpress mod. But that was too complicated for my needs

10 Dec 2007, 8:52 PM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Adding Wordpress to Zen Cart

I would either rewrite the WP code a bit, or you can do a trick like this: assign a class to all the links (should be done easily using WP template system). Then use JS to automatically find and insert target="_blank" for all link (elements) of that class.