WordPress.org

Ready to get started?Download WordPress

Forums

Single page entry (11 posts)

  1. andemad
    Member
    Posted 9 years ago #

    Hi there,

    I've got some old pages coded in php with inline css styles - I want to add them to my newly installed WP site. I can use pages - but then I'd have to avoid php-scripts.

    Is there any way I can do a framework of a "blank" WP default page, and do an
    <?php include ("mypage.php"); ?>
    , in the empty area?

    Thanks,

  2. Minna
    Member
    Posted 9 years ago #

    you could make a template:

    <?php
    /*
    Template Name: My page
    */
    ?>
    <?php get_header(); ?>
    <?php include("mypage.php"); ?>
    <?php get_footer(); ?>

    put it in the correct theme folder, then make a page and use that template for it (select from dropdown in Page Options below the textarea). Or whack all the code in there instead of include()

  3. andemad
    Member
    Posted 9 years ago #

    Hmm - didn't see that option. Thanks :)

    How can I get the sidebar in there also?

  4. Minna
    Member
    Posted 9 years ago #

    Well, I have it in my footer template so it comes along with get_footer(). The main template should show in which order to put the calls. You get the sidebar with <?php get_sidebar(); ?>

  5. radial
    Member
    Posted 9 years ago #

    just a note, i wanted to add the sidebar to single posts. so in single.php at the bottom right above the get_footer call, i put the get_sidebar call just like the index page has. but it always put the sidebar far down on the right hand side, below the post! i finally figured out at the top of single.php modify
    <div id="content" class="widecolumn">
    to
    <div id="content" class="narrowcolumn">

  6. xmiinc
    Member
    Posted 9 years ago #

    Radial-->I figgered out the same thing this morning but...do you get the *whole* sidebar? I'm only getting the default sidebar when I also would like to have add-ons like keywords, polls, and recent_comments (all plugs) in Single posts.

    The whole sidebar, including plugin mods, shows up fine inside Archives, just not in single posts. After inspecting code in sidebar.php, single.php, archive.php, even template_functions_...I've started looking for tests somewhere in The Loop that might be stripping out these plugin calls, but so far nothing's jumped out at me...

    Can anyone advise?

    Cheers!

  7. moshu
    Member
    Posted 9 years ago #

    @xmiinc,
    which theme? link?

  8. xmiinc
    Member
    Posted 9 years ago #

    aw, geez...I *knew* this would happen sooner or later. Its not public yet. But if it helps: http://www.citixen.org

  9. moshu
    Member
    Posted 9 years ago #

    As I suspected :) It is based on the Deafult and that handles the sidebar differently depending on what you are viewing. OK, I know, you are past that... but if your sidebar.php template is based on K. you can see there (at least in the original!) a lot of if statements, saying to show this and that depending whether you are on a single, archive, category etc. page. I guess some of that code is in your sidebar.php, thus showing and hiding different portions of it depending on what you are viewing.

  10. xmiinc
    Member
    Posted 9 years ago #

    Thanks, Moshu...now that you mention it, I do remember seeing some tests like that in the past (when I didn't care!). Guess I've gotta look a little harder!

    Cheers!

  11. xmiinc
    Member
    Posted 9 years ago #

    Sure enuf, it was simple...even simpler than I suspected! Turns out sidebar.php itself contains the test. I had all these extra widget calls *outside* the if...then test. Simply moving them inside did the trick.

    It was literally staring me in the face the whole time. DOH#@!

    cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.