WordPress.org

Ready to get started?Download WordPress

Forums

Theme Switcher: New Page? (7 posts)

  1. AijoNeko
    Member
    Posted 9 years ago #

    I am using Ryan Boren's theme switcher and I want to make a new page that will switch themes as well, but I don't want to use WP's page option. Is this possible? If so, what piece of coding what I put into the page to make it work? Thanks in advance for any replies.

  2. Kafkaesqui

    Posted 9 years ago #

    AijoNeko, I'm sorry but I don't quite understand what you asking for. When you say "new page," do you mean an external php document that's using the WordPress theme feature? If so, you'll probably need to modify Theme Switcher itself, since it's coded to redirect to your blog's home page after a theme is set.

    If you meant something else, please try to elaborate.

  3. AijoNeko
    Member
    Posted 9 years ago #

    Yes, that's what I meant. Having it redirect to my blog isn't a big deal since it's the main part of my site. However, I still can't figure out a way to add a page that adheres to the set theme.

  4. moshu
    Member
    Posted 9 years ago #

    Just trying to understand your request, AijoNeko.
    So, you want to have a "page" in an external php document as Kaf said, but you still want this file to have exactly the same style as your blog, even more, to change its style with the style-switcher...
    Then why not use the Pages feature? It was created (after popular demand) exactly to have "pages" that look exactly like the rest of the blog.
    Maybe I am missing something, but I can't get why not use the Pages feature? Is there any specific reason?

  5. AijoNeko
    Member
    Posted 9 years ago #

    I can't find a way to rename it something.php as I wanted it to. It find it confusing to use page numbers.

  6. moshu
    Member
    Posted 9 years ago #

    If your server has mode_rewrite enabled then you can use your permalinks and that would result to have page names like
    yoursite.com/blog/aboutme
    About permalinks see the Codex:
    http://codex.wordpress.org/Using_Permalinks

  7. Kafkaesqui

    Posted 9 years ago #

    AijoNeko, if you can't implement mod_rewrite like moshu suggests (which if you can, is easiest), then here's the steps for setting up an external php page to use WordPress theming (and to display your Page content):

    1. First, add this to the top of your php file:

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

    Make sure the path to wp-blog-header.php is correct.

    2. Set up the layout in your file to match that of the templates in your theme. Quickest way to to do this is to copy all the layout and php elements from the theme's index.php into your file (if the theme has a page.php, use this).

    3. Install my Get-a-Post plugin, and use the get-a-post() tag in place of The Loop in your custom template to call the specific Page to display.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags