• Resolved waigy

    (@waigy)


    I have an existing website, and want to add a single blog page.
    I want that blog page to show my complete wordpress blog including the wordpress top bar, header, titles, content, theme, search box, archives, comments box, the lot.

    But, all of this must be below my existing website’s navigation bar.
    I want people to stay on my website and read all the wordpress stuff (including “read more” links) from my single blog page.

    I’ve tried using the following instructions and much more:
    https://codex.www.ads-software.com/Integrating_WordPress_with_Your_Website

    The closest I’ve got is for the titles and content to appear under my navigation bar.

    Is it easier to add my existing navigation bar above my wordpress page or to add wordpress to my blog page?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hmm… I see a couple ways you could go about this…

    • Create a custom theme for WordPress that looks exactly like your current site’s theme. If your site is already set up to use some sort of template system, this’ll be much simpler to do… you’ll just need to copy your templates to a new folder within wp-content/themes and WordPress-ify them. With this method, you’ll get close visual integration with your existing site. If you want to in the future, you can also put your whole site under control of WordPress.
    • If every page needs to be on one particular URL, you can either embed using an iframe (using a really light custom theme) or use lower-level WordPress functions to roll your own WordPress front-end. Your custom interface would essentially need to take over the querying and processing tasks that the WordPress core usually handles on its pages. Admittedly, I’ve never really used WordPress functions on pages that aren’t under control of WordPress (as shown using the wp-blog-header.php include), but it makes sense.

    I hope this helps!

    Thread Starter waigy

    (@waigy)

    Hi zimmi88

    Thanks for the reply.
    The twenty eleven dark theme looks pretty close to the current website.

    I’ve managed to insert my existing navigation menu just underneath the top wordpress bar using the “Custom headers and footers” plugin.

    This is agonisingly about 30 pixels away from what I am looking for.

    As I mentioned in my first post, I also have a different approach using the code in the first post’s link.
    This shows my own background image, my own navigation bar, but only the titles and content of my wordpress posts.

    I used this code :

    <?php
    // Include WordPress
    define(‘WP_USE_THEMES’, true);
    require(‘./blog/wp-load.php’);
    query_posts(‘showposts=10’);
    ?>

    <?php while (have_posts()): the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>
    <?php endwhile; ?>

    Is it possible to add the rest of the wordpress page using extra html?
    Eg. add the comments box, archives etc?

    You mean add other information from your posts to every post on your homepage? It’s certainly possible… just add the appropriate template tags to your Loop. WordPress is quite malleable, so if you’re willing to put the time and effort into diving into the lower-level operations, you can do some rather interesting things with it. Currently, your loop only outputs the content of your posts, according to the code posted above. As for whether that’ll cause long loading times or navigation issues, you’ll need to try stuff out and tweak things accordingly.

    That said, for comments, the comments_template() function might not work, as it’s designed for single posts/pages. You might need to code a custom solution for this.

    As for the aforementioned 30 pixels… are those there when you’re logged out as well? That could be the WordPress Admin Bar peeking in, which pushes content down when it’s added. Otherwise, some CSS tweaks will probably solve the issue.

    I hope this helps!

    Thread Starter waigy

    (@waigy)

    Hi zimmi88

    I’ve got it sorted now using my own navigation menu bar just below the wordpress bar.
    Both bars stay fixed at the top when scrolling.
    It took me ages to get it working properly, mostly by trial and error.

    The 30 pixels I mentioned are just the fact that my menu bar is below rather than above the wordpress bar.
    It’s 30 pixels away from where I really want it to be.

    I’m pleased enough with it the way it is now.

    Thanks again for the help.

    Thread Starter waigy

    (@waigy)

    As a noob I didn’t realise that the wordpress bar at the top of the page isn’t there when you are logged out, so it is working as I wanted it to.

    I have now progressed onto my next problem which is in the plugins and hacks forum.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Want to add complete wordpress page to a single page on existing website’ is closed to new replies.