Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Plugin Contributions
    0

    Default Wordpress on main_page

    Since i've scoured the net and haven't found something that works....i have pieced something together that seems to work just fine. I am posting it here for those who are having issues with doing the same thing i wanted to do, which was have wordpress on my main page without a fancy url to get to it.

    First things first is to use the Wordpresson ZenCart mod found here: http://www.zen-cart.com/forum/showth...ess+on+zencart

    If you want it to be displayed just like on the "[zencart URL]/?" page (or whatever that really long url is) use this:

    <?php
    require('includes/templates/template_default/templates/tpl_wordpress_default.php');
    ?>

    If you want it displayed like an archival link table (to see what i mean, check out the bottom of the page here: http://www.fivecorners.net/shop ):

    <?php
    require('includes/extra_configures/wordpress-config.php');
    ?>
    <fieldset>
    <legend>Archived Blog Posts</legend>
    <?php
    $posts = get_posts('numberposts=');
    foreach($posts as $post) :
    setup_postdata($post);
    ?>
    <a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>">
    <?php
    the_title();
    ?>
    </a>
    <?php
    /*the_content();*/
    ?>
    <br />
    <?php endforeach; ?>
    </fieldset>



    Add a # after numberposts=, but before the ' for however many links you want there to be in the box for prior posts. I left it blank as i believe (not very thouroughly tested) that it will add *all* posts instead of the most recent 3 or 5 or whatever number you put there.

    -Brian 'Tvhawk' Hochstein

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Wordpress on main_page

    I'm getting a 'headers already sent' error in the main page.

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Wordpress on main_page

    Visit
    http://codex.wordpress.org/The_Loop
    Then add code to define_main page file of your current zencart template
    Code:
    <?php
    require(‘./wp-blog-header.php’);
    ?><?php
    $posts = get_posts(‘numberposts=3′); // change to whatever number of posts to show
    foreach($posts as $post) :
    setup_postdata($post);
    ?>
    <h2><a href=“<?php the_permalink(); ?>”><?php the_title(); ?></a></h2>
    <?php the_date(); ?>
    <?php the_content(); ?><hr />
    <?php endforeach; ?>
    as per centre main column at
    http://www.dezinashop.com/demo/

  4. #4
    Join Date
    Nov 2009
    Posts
    7
    Plugin Contributions
    0

    Default Re: Wordpress on main_page

    Where am i supposed to put the Loop info in the index.php file? I am somewhat of a noob when it comes to coding.

    I have placed the other code within the default "define_main" as the template I am using does not have its own.

    I am picking up the following error as it stands -
    Parse error: syntax error, unexpected '/' in /home/content/t/b/c/tbcroaster/html/includes/languages/english/html_includes/define_main_page.php on line 2

  5. #5
    Join Date
    May 2006
    Posts
    321
    Plugin Contributions
    0

    Default Re: Wordpress on main_page

    I think Wordpress has changed quite a bit since that post was written. Here's the code I used:

    PHP Code:
    <?php define('WP_USE_THEMES'false); get_header(); ?>

        <?php if (have_posts()) : ?>

            <?php while (have_posts()) : the_post(); ?>

                <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

                    <div class="entry">
                        <?php the_content('Read the rest of this entry &raquo;'); ?>
                    </div>

                </div>

            <?php endwhile; ?>

        <?php else : ?>

            <h2 class="center">Not Found</h2>
            <p class="center">Sorry, but you are looking for something that isn't here.</p>
            <?php get_search_form(); ?>

        <?php endif; ?>
    That worked for me.

  6. #6
    Join Date
    Oct 2010
    Posts
    9
    Plugin Contributions
    0

    Default Re: Wordpress on main_page

    Quote Originally Posted by digidiva-kathy View Post
    I think Wordpress has changed quite a bit since that post was written. Here's the code I used:

    PHP Code:
    <?php define('WP_USE_THEMES'false); get_header(); ?>

        <?php if (have_posts()) : ?>

            <?php while (have_posts()) : the_post(); ?>

                <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

                    <div class="entry">
                        <?php the_content('Read the rest of this entry &raquo;'); ?>
                    </div>

                </div>

            <?php endwhile; ?>

        <?php else : ?>

            <h2 class="center">Not Found</h2>
            <p class="center">Sorry, but you are looking for something that isn't here.</p>
            <?php get_search_form(); ?>

        <?php endif; ?>
    That worked for me.

    I used that code. The posts show up on the main page but when i click on them they just go back to the home page.

    the link is come up with - website.co.uk/&p=1
    when its meant to be - website.co.uk/index.php?main_page=wordpress&p=1

    and there is no styling

    Do you know what to do?

 

 

Similar Threads

  1. v139h Wordpress on ZC?
    By stitchnkitty in forum General Questions
    Replies: 13
    Last Post: 20 Jun 2014, 11:32 PM
  2. Link issue - main_page=product_info / main_page=_info
    By Chrome Orange in forum General Questions
    Replies: 5
    Last Post: 7 May 2010, 05:34 AM
  3. wordpress
    By jenn8five in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 13 Aug 2008, 10:44 AM
  4. WordPress 404's
    By doodlebee in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 2 May 2007, 01:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR