WordPress.org

Ready to get started?Download WordPress

Forums

Integrating WP in an existing site (10 posts)

  1. fireworkszone
    Member
    Posted 7 years ago #

    I read with great interest the article from Moshu you can read: http://www.transycan.net/blogtest/2005/07/05/integrate/1/

    This is the proof that a specific documentation is necessary on wordpress website for people like with an existing design trying to integrate WordPress.

    1- In the tutorial the call on the wp-blog-header.php is incorrect from experience. It should be:

    <?php
    define('WP_USE_THEMES', true);
    require('./blog/wp-blog-header.php');
    ?>

    and not only:

    <?php
    require('./blog/wp-blog-header.php');
    ?>

    2- It doesn't work for me. At least not completely. I can only see my posts: http://www.fireworkszone.com
    But the footer disappeared and I cannot add the sidebar items: calendar, categories, etc in my left or right existing sidebars (belonging to the 3-column layout design already in place).

    I tried both: wordpress in the root directory and in a blog folder with the same results.

    3- Whooami let me know that my Server API is not Apache but CGI/ProXad. This is maybe what is the cause of the problem.

    Thanks for your help because I am bit desperate.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Integration with an existing site is really something that should only be attempted by experts. You not only need to know exactly how the existing site works, but also how WordPress works. Any tutorial is going to have to be vague, at best, because it cannot possibly tell you how your site already works.

    Moshu's tutorial is good and helpful, but mainly it's telling you how WordPress works, at the most basic level.

    And the tutorial is correct, you DON'T want to use themes. That's the whole point of the tutorial, you're integrating it into your existing site. If you turn on the use themes, then you're not really integrating anything, it's using the WordPress themes. The tutorial is telling you how you can use WordPress without themes, in order to make it go into your site instead of doing the theme.

  3. fireworkszone
    Member
    Posted 7 years ago #

    Hi Otto42,

    That's interesting and sounds logic.

    The tutorial is telling you how you can use WordPress without themes, in order to make it go into your site instead of doing the theme.

    Good,if you are not using themes you should therefore use this code:

    <?php
    require('./blog/wp-blog-header.php');
    ?>

    I tested with the above code and I can't see my posts anymore!

    Do I have to uncheck the use of themes in the administration panel or else ?

    If you are not using themes where do the posts come from?

    I am really really confused

  4. moshu
    Member
    Posted 7 years ago #

    The posts are NOT stored in your themes - they are always in the MySQL database.

    [and Otto's first sentence is very valid!]

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Moshu's tutorial basically tells you how to include the base WordPress code, and then how to make a "Loop". The_Loop (capital-L) is what actually displays your posts. All themes include a Loop, but this tutorial tells you how to insert a Loop into your own site, to display the posts.

    Until you insert a Loop, you won't see any posts. That's what The Loop does.

  6. fireworkszone
    Member
    Posted 7 years ago #

    I tried this code on my index page in the root directory:

    <?php
    require('./wp-blog-header.php');
    ?>

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

    <div class="post" id="post-<?php the_ID(); ?>">

    <div class="storytitle">
    <h3><?php get_cat_icon(); ?> " rel="bookmark"><?php the_title(); ?></h3>
    </div>

    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>

    <div class="meta">
    <img src="../pictures/icons/icon_clock.gif" alt="clock" height="16" width="16"/>

    <?php the_date('','',''); ?> <?php the_time() ?> <img src="../pictures/icons/icon_user.gif" alt="Your Comments" height="16" width="16"/> posted by <?php the_author() ?> <img src="http://www.fireworkszone.com/pictures/icons/comment_blue.gif" height="16" width="16"/>

    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>— <?php _e("Filed under:"); ?> <?php the_category(',') ?> </div>

    <div class="feedback">

    <?php wp_link_pages(); ?>

    </div>

    </div>

    <?php comments_template(); ?>

    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>

    <?php posts_nav_link(' — ', __('« Previous Page'), __('Next Page »')); ?>

    And it works! See http://www.fireworkszone.com

    To integrate the calendar I added to my left sidebar this code:

    <?php
    require('./wp-blog-header.php');
    ?>

    <?php get_calendar(); ?>

    And it works for the rest of other items: categories, search form, etc.

    However, I am now facing a new problem: the navigation inside the site is no longer working. I used to call different pages with a root.php file with switches inside:

    <?php
    include_once( $sources."objet/RequeteObjet.php" );
    include_once( $sources."objet/ComptageObjet.php" );

    switch ($root) {
    case"1":
    include("tuts_en.php");
    break;
    case"2":
    include( $sources."incAffichageTutorial.php" );
    break;

    default:
    include("central.php");
    }
    ?>

    It is the central.php file which contains the code to call on wp (see at the top).

    For example: http://www.fireworkszone.com/?root=5&idLogiciel=4&extension=1 is no longer working

    Could you please help me fix this problem because I am now without navigation

    Thanks

  7. fireworkszone
    Member
    Posted 7 years ago #

    1- With the method I described above (read top of the page), my posts are displayed correctly inside my existing design

    2- BUT as soon as I include this code (see below) to integrate the calendar for example in one of the two existing sidebars (right and left) my navigation system with the root.php won't work

    <?php
    require('./wp-blog-header.php');
    ?>

    <?php get_calendar(); ?>

    Could someone help me integrate the calendar, categories, meta, search, etc in my sidebars without affecting the navigation system

    I have never been so close as to integrate WP in my existing site

  8. fireworkszone
    Member
    Posted 7 years ago #

    Any help please. I keep on struggling to integrate wp in my website.

    To display the calendar I also tried

    <?php
    include('./wp-config.php');
    ?>
    <?php get_calendar(); ?>

    With the same result: the calendar is displayed correctly but the site navigation is down

    You can contact me: fireworkszone@free.fr

    Thanks

  9. fireworkszone
    Member
    Posted 7 years ago #

    Any help would be appreciated

  10. anush42
    Member
    Posted 7 years ago #

    I used this successfully:

    <?php
    define('WP_USE_THEMES', false);
    require('./blog/wp-blog-header.php');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic