How to create a checkbox option for WordPress themes (2 posts)

  1. SuperMario290
    Posted 6 years ago #

    Hello everybody. Okay so in my options page for my WordPress theme I would like to create a checkbox that would be for gravatars. If you check it, they're shown, if not, then obviously they're not.

    I know how to do regular options, but I have no idea how to do this. Here's what I've got from other resources on the internet but haven't been able to do this.

    array( "name" => "Gravatar",
    	"desc" => "Check if you would like Gravatars or not",
    	"id" => $shortname."_gravatar",
    	"type" => "checkbox",
    	"std" => "false"),

    and then for the index.php

    <? if get_option('$spress_gravatar') { ?>
    <? echo get_option('$spress_gravatar_display'); ?>
    <? } else { ?>
    <? echo get_option('$spress_gravatar_no'); ?>
    <? } ?>

    I have no idea if that's right, but if ANYONE can help me out it would a tremendous help.

  2. SuperMario290
    Posted 6 years ago #

    Anybody? Anybody......

    ANYBODY!!! :O haha

Topic Closed

This topic has been closed to new replies.

About this Topic