Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter assumptionsoup

    (@assumptionsoup)

    Thanks for writing such a long reply. I’ve given it a good long try and after thinking it over a bit I’m still not entirely sure you understand what I’m trying to do though. I want a blog on a single page of my wordpress website. I want to be able to have blog posts and pages on other parts of the website completely separate from the blog page. The website page is not going to have any blog navigation, the fact that I’m using pages, posts and categories to display the information on these parts of the website should be transparent to the user. Only the blog part should actually look like a blog.

    Using the method of installing two wordpresses, if someone would help give me a clue, I could theoretically accomplish this. Since the only place the two wordpresses need to interact is at the header, where the navigation and a rotating tagline is displayed.

    The reason I like this approach is that. 1. After the initial install there is virtually no maintenance. I can update the same theme on both blogs, and keep a minimum of plugins on the blog wordpress install (probably just email obfuscation). I can update my website area from my website wordpress, and my blog from my blog wordpress.

    Using the method you suggested of only including a parent category is much easier for me to accomplish on my own, but has several more annoying drawbacks. 1. Including or excluding, no matter which method I use, it is still adding code to my theme that is hardcoded to my “blog” category. I have to update every single page in the theme to accomplish this. And should the design at any point change, I will have to change that hardcode. 2. It requires the small maintenance of making sure every blog post is in a category parented under the “blog.” Uncategorized blog posts will mysteriously disappear from my website. 3. I’m not sure why you mentioned having a pagination problem with including an entirely separate page, it seems that the bigger pagination problem is with including only the children of a parent category. next_posts_link and previous_posts_link weren’t built to search categories. wp_list_categories has a nice child_of parameter, but nothing else does. I’m going to have to research how to write a custom loop for everything that doesn’t.

    So far, I’ve written custom conditional and loop statements for the archives and index, sidebar, and for recent posts to only include categories that are parented under the “blog” category, while not displaying “blog” itself anywhere. All that code seems like overkill if the right combination of php includes could combine two blogs into a blog within a blog. And yes, I’ve looked at that plugin blog-in-blog, and it doesn’t do what I want (it doesn’t work with a sidebar navigation).

    If anyone could point me to a way to do what I originally asked, or perhaps a tutorial on the “parent category” approach, I would greatly appreciate it. Personally, I think this parent category approach seems more against the way wordpress is supposed to function than simply including one wordpress within another. But that’s just with the little I’ve found while customizing my theme and trying to place a blog in my website.

    Thread Starter assumptionsoup

    (@assumptionsoup)

    Alright, so one of my “static” pages, actually points to a category so I can dynamically add extra posts to that static page as needed and have them formatted nicely for me. How would I exclude this category from the blog nav-bar, while keeping all the blog-related categories?

    I have a feeling you’re going to mention some way to exclude pages and categories from the navbar. I don’t know, keeping two wordpress installations actually sounded pretty nice to me, since it meant I didn’t have to try to write custom excludes for categories all over the place. Excludes that most likely involve mucking around in the wordpress theme php. Logging into my blog to update my blog, and my website to update my website seemed much more headache-free in the long run if I can get it set up correctly just once.

    Thread Starter assumptionsoup

    (@assumptionsoup)

    I’m doing it this way because I wanted to have a cms for my website in general in addition to my blog. I don’t want pages, and subpages (posts, categories, and actual pages) from my website showing up as links to blog articles.

    Thread Starter assumptionsoup

    (@assumptionsoup)

    Update: Here are some of the things I have tried:

    I’ve tried this straight from the Integrating WordPress page:

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

    Results in:
    Absolutely nothing. Completely blank page. Html is empty.

    I’ve tried requiring the header.php in my theme directory:

    <?php
    define('WP_USE_THEMES', true);
    require('Path-To-Theme-Header');
    ?>

    Results in:
    Warning: require() [function.require]: Unable to access Path-To-Theme-Header
    Warning: require(Path-To-Theme-Header) [function.require]: failed to open stream: No such file or directory

    I’ve tried the plain old php include:
    <?php include('Path-To-Theme-Header'); ?>

    Results in:
    Warning: include() [function.include]: URL file-access is disabled in the server configuration
    Warning: include(Path-To-Theme-Header) [function.include]: failed to open stream: no suitable wrapper could be found
    Warning: include() [function.include]: Failed opening ‘Path-To-Theme-Header’ for inclusion (include_path=’.:/usr/share/pear’)

    I’ve tried this code I found somewhere along the way…

    <?php
    define('WP_USE_THEMES', false);
    require('../wp-load.php');
    query_posts('showposts=1');
    ?>
    <?php while (have_posts()): the_post(); ?>
    <?php endwhile; ?>
    <?php while (have_posts()): the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_excerpt(); ?>
    <p><a href="<?php the_permalink(); ?>">Read more...</a></p>
    <?php endwhile; ?>

    Results in:
    Showing the default post of my blog twice. Not the post from my cms website, which it should be able to grab.

    I’ve tried using the code in the example from this tutorial

    Which results in:
    Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

    In case anyone was wondering and couldn’t tell from the above, my website has the wordpress cms at the base url, and the blog at mysite.com/blog.

    I feel like I’m just hitting my head against the wall here. Can anyone offer some useful suggestions? Would integrating both wordpresses into one sql database make a difference perhaps? Since the one attempt that did result in a page, just seemed to be accessing the wrong database.

Viewing 4 replies - 1 through 4 (of 4 total)