WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Feedback needed on is_page and more functionality (2 posts)

  1. bitbybit
    Member
    Posted 7 years ago #

    Bear with me as I try to explain my situation and request. It'll be a bit long-winded in the attempt (hah!) at clarity. With that said...

    I was hoping to gather some feedback on the best way to go about getting a specific page that serves as my blog home to display the "--more--" links on posts when they are there, or perhaps an alternative installation to what I currently have.

    I have a tweaked wordpress installation with basically the following layout:

    /website
    --/blog

    Basically what I am doing is in the /website directory I have an index.php file that requires the wp-blog-header.php file from the /blog subdirectory. What I hoped to accomplish was have /blog serve as, well, the blog (ha!) so any new posts are linked there, in addition to being the wordpress installation directory where all the wp files are stored. I wanted to use wordpress as a quasi-cms, so any pages created are linked off of the root (/website) directory, rather than underneath the /blog/ subdir.

    The problem i'm having is that in order to get things setup that way, I had to create a template and page called "blog". Since "blog" is technically a page (as well as a subdirectory), when I run "the loop", no posts with a "--more--" link in them are shown as such, instead the full post is printed out.

    I seem to have found a work around by adding the following line after line 1179 in wp-includes/query.php:


    $more = 0;

    Nothing fancy I know, but it seems to have addressed my problem w/o impacting anything else that I could see. I've made the same change on a vanilla dev blog (that is to say, one w/o any of the strange directory/path customization weirdness I use on my live website) and gladly it seems to respond how one would expect with "--more--" posts.

    So... since this now works, I was hoping for feedback on 1) if there is another newer/easier/better way I should've setup my site in order to avoid issues like these but still maintain the functionality I outlined above, and 2) if I am currently doing it in the "best" way, would adding the small code snippet I used above to query.php break any functionality that i'm unaware of? I am definitely a bit of a noob when trying to follow the code around, so apologies for that.

    If nobody can think of a better way to do what i'm trying to do and it doesn't impact any other users, I was thinking about submitting it as a patch to be merged into the wordpress release distro.

    If you've read this far, I probably owe you some indian food or something ;)

    Feedback is VERY appreciated :)

    Thanks!

  2. bitbybit
    Member
    Posted 7 years ago #

    Ended up finding and using the Home Page Control Plugin which fixed the issues I was running into :)

    Would be great to see this rolled into the core wordpress source as an option to be more of a CMS out of the box, but I can see why it might not be for everyone.

Topic Closed

This topic has been closed to new replies.

About this Topic