WordPress.org

Forums

[resolved] theme switcher without using widget (7 posts)

  1. adnapa
    Member
    Posted 6 years ago #

    Is there any plugin that I can use to switch between multiple themes currently installed in my wordpress? I know there is one plugin that is available: theme-switcher-reloaded, but that requires a widget which requires a sidebar in-order for that to work. here's the thing, I only like using themes that contains one column and I have my own handed sidebar。And all the codes in my page is html (not .php) So is there any other plugins available that doesn't require a sidebar or widgets for it to work? or a specific kind of code that allows me to control the themes?

    Sorry for my poor english, and thanks in advance to anyone that answers!

  2. MichaelH
    Member
    Posted 6 years ago #

    I believe you could use this http://wordpress.org/extend/plugins/theme-switcher/. And even though it says to use in your sidebar, I think you could put this in most any template.

    To use, add the following to your sidebar menu:
    
      <li>Themes:
    	<?php wp_theme_switcher(); ?>
      </li>
    
    This will create a list of themes for your readers to select.
    
    If you would like a dropdown box rather than a list, add this:
    
      <li>Themes:
    	<?php wp_theme_switcher('dropdown'); ?>
      </li>
  3. adnapa
    Member
    Posted 6 years ago #

    Thanks for the reply MichaelH.
    I'm thinking I probably didn't explain it more clearly, but the code you provided, I would have that put that in my one column template in order for that to work, am I correct? Say, I want to somehow use a code and place it in my own handed code, would that be possible? Perhaps inside a div tag?

    I hope this kind of makes it more clear?

    Thanks in advance again!

  4. MichaelH
    Member
    Posted 6 years ago #

    handed code

    Not to sure what that means...

    For discussion, if you are using WordPress Default Theme you could put that code in the header.php, the footer.php, the sidebar.php, or even index.php.

    Please review:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  5. danydareck
    Member
    Posted 6 years ago #

    If you want to use it in a div just put:

    <div id="themeswitch">
    <span>Themes:
    <?php wp_theme_switcher('dropdown'); ?></span>
    </div>

    where ever you want.

    ...anyone know how could I modify this plug-in in order to select 2 or how many themes I want but not all that I have installed? (I will open a post later if I will not find out..still trying :) )

  6. MichaelH
    Member
    Posted 6 years ago #

    danydareck - to a theme's style.css add a line such as Status: NotPublic right after the Author: line.

    Then delete that line or change it to Status: publish if you want allow the theme switcher to see that theme again.

  7. danydareck
    Member
    Posted 6 years ago #

    Thank you for replaying

    That suppose to be first step on something more complicated.
    I'm using 4 themes at the moment and I wanted to add a button that disables 2 of my themes and a button that disable the other 2.(like 2 country flags: 2 themes in one language other 2 themes in other language)

    I manged to do that. Modified plug-in.

    Thanks again

Topic Closed

This topic has been closed to new replies.

About this Topic