• ohcait

    (@ohcait)


    I’m using ryan’s theme-switcher plugin, and it works great, but I need to know how to make it so that not every theme shows up on the list on my site. (For example, I want to keep the default and classic themes installed, but I don’t want users to be able to choose either.)
    I know that there is a way to do this, but I’m too much of a fool with php to understand how to do it without any guidance.
    Thank you!

Viewing 15 replies - 1 through 15 (of 17 total)
  • Root

    (@root)

    Take out the meta header in the CSS.

    Kafkaesqui

    (@kafkaesqui)

    If you update to version 0.3 of Theme Switcher, Ryan has prepped it for the “Status” header line in a theme’s style.css. So if you add this to a theme’s css header:

    Style: draft

    It won’t be displayed by the switcher.

    Jaxia

    (@jaxia)

    If this is a lame question, I apologize.

    I’m trying to tweak a theme and so I installed the theme switcher to make my life easier. But, it automatically places the themes list in my sidebar. I don’t want the option to switch to show up at all.

    I cannot figure out exactly what code I need to take out of which file to still have the theme switcher work when I type the theme name in the URL but not show ANY options for switching on my home page.

    Help? Thanks!

    Kafkaesqui

    (@kafkaesqui)

    Look in your current theme’s sidebar.php for something like this:

    <?php if (function_exists('wp_theme_switcher')) : ?>
    <ul>
    <?php wp_theme_switcher(); ?>
    </ul>
    <?php endif; ?>

    Just remove that section.

    Jaxia

    (@jaxia)

    Hmm.

    I am currently using the Amsterdam theme. I found this in my sidebar:

    <?php if (function_exists(‘wp_theme_switcher’)) { ?>
    <h4><?php _e(‘Themes’); ?></h4>
    <?php wp_theme_switcher(); ?>
    <?php } ?>

    I removed it, activated the plugin and the theme didn’t switch. Put it back in, and the theme switcher works.

    Ideas?
    (My wesbite is stealtheblinds.net)

    Kafkaesqui

    (@kafkaesqui)

    Makes no sense from where I’m sitting, since all the switcher links/dropdown do is pass the exact url query you’re providing manually. Assuming you’re using the correct one.

    mhancock

    (@mhancock)

    Twice I’ve had the Theme Switcher plugin (v0.2) activated and switched to a Theme where I didn’t have the theme switcher code in the sidebar and I got ‘stuck’ in that theme regardless if I deactivated the plugin or changed the Active Theme in the Dashboard.

    So I deactivated the plugin, deleted the wp-content/themes/xxxxx directory (xxxxx being the offending Theme), changed the Active Theme to one that had the correct switcher code in the sidebar, activated the plugin, and all was good.

    Of course I reinstalled the deleted Theme and added the theme switcher code to the sidebar.

    Kafkaesqui

    (@kafkaesqui)

    mhancock: Next time just try deleting your browser’s cookie file for your site.

    Jaxia

    (@jaxia)

    Kafka, since the theme switcher query in the browser works when I leave the above code in the sidebar, I’d guess I’m using the right query.
    /?wp-theme=themenamehere

    Do I need to put a line a code somewhere else? I don’t know enough php (none, really) to know what that code I took out (and put back in) does. Did I take out too much?

    prissed

    (@prissed)

    There’s another theme switcher (same filename), only it’s in french. But, I think it gives the option to select which themes to display.

    Of course (and this is just my personal opinion, so don’t put too much stock in it), I don’t trust something that I can’t read and understand…but again, that’s just me. πŸ˜‰

    Edit: link would be nice, eh?
    http://386a.net/scripts/wp-plugins/theme-switcher.zip
    http://386a.net/blog/wordpress/theme-switcher/
    http://wp-plugins.net/index.php?id=118

    Jaxia

    (@jaxia)

    Yikes. French? I might have to wade through it if I’m ever going to get any updates done to my site. πŸ™‚

    Does anyone know how to make the theme switcher work without showing the list of themes in the sidebar?

    prissed

    (@prissed)

    Yeah, if it’s installed, you don’t have to list it in your sidebar.

    Just go to the url of your blog like this:

    http://yourblog.com/index.php?wptheme=Theme+Name

    Kafkaesqui

    (@kafkaesqui)

    Jaxia: Note the lack of a dash in prissed’s query example above (i.e. wptheme, not wp-theme)..

    Jaxia

    (@jaxia)

    Strange…this is what wound up working for me:

    http://www.stealtheblinds.net/index.php?wp-theme=themenamehere

    I have to use the dash and the index. I don’t know why – but it works!

    Thanks for all of your help!

    Kafkaesqui

    (@kafkaesqui)

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Hide unpublished themes with theme-switcher.’ is closed to new replies.