WordPress.org

Ready to get started?Download WordPress

Forums

Geek Switch ... or turn off some categories (4 posts)

  1. e-head
    Member
    Posted 9 years ago #

    having tech and non-tech mixed on the blog is disturbing me a bit. i have this idea. i could have a "user setting", that either shows ONLY tech, NO tech, or mixed. it would use a cookie and hence would preserve the settings between visits.

    enter the geek switch !

    http://dotsandloops.net/blog/2005/04/08/wordpress-geek-switch/

    lmk what you think

  2. jwurster
    Member
    Posted 9 years ago #

    That's cool. I'm trying to take what you've done and "turn off" my counters when I am in Admin mode. I am having one difficulty in getting an error from index.php. Can you help?

    Parse error: parse error, unexpected T_VARIABLE in /home/jimw3141/public_html/wordpress/wp-content/themes/test/index.php on line 6

    <!-- ### Check for geek cookie in index.php file ### -->
    <!-- ### Geek Stuff or not ? ### -->
    <? php
    $dnl_geek = $_COOKIE['geekstuff'];
    if($dnl_geek == 'off') {
    $cat = '-2';
    }
    ?>

    <?php get_header(); ?>

  3. e-head
    Member
    Posted 9 years ago #

    Looks like you just need to get rid of the space between the "<?" and the "php" maybe.

    <?php, not <? php

  4. skeltoac
    Member
    Posted 9 years ago #

    That error could mean that $dnl_geek is undefined. Test for that.

    As an aside, you might benefit from putting your variables after the == when doing logical comparisons. See the Coding Style Guidelines, in the last paragraph.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.