Need Help in wordpress functions.php

Discussion in 'PHP' started by Wp-Mod.Com, Jan 10, 2010.

  1. #1
    currently i was trying to edit my theme when i bumped upon this , it doesn't seem to be working , it is code for radio buttons in wordpress

    this is my code

    <?php if (get_option('wp_show_featured') == 'Enable') { ?>
    test again 
    <?php } ?>
    PHP:
    array(  "name" => "Show Featured on Index?",
            "desc" => "Check this box if you want to show featured post on index.",
            "id" => $shortname."_show_featured",
            "type" => "radio",
            "std" => "Disable",
            "options" => array("Disable", "Enable")),
    PHP:
    <?php foreach ($value['options'] as $key=>$option) {
    				$radio_setting = get_option($value['id']);
    				if($radio_setting != ''){
    					if ($key == get_option($value['id']) ) {
    						$checked = "checked=\"checked\"";
    						} else {
    							$checked = "";
    						}
    				}else{
    					if($key == $value['std']){
    						$checked = "checked=\"checked\"";
    					}else{
    						$checked = "";
    					}
    				}?>
    				<input type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $value['id'] . $key; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><label for="<?php echo $value['id'] . $key; ?>"><?php echo $option; ?></label>
    				<?php } ?>
    PHP:
    but it does not execute well , i think so the problem is in the first part where i execute it .
     
    Last edited: Jan 10, 2010
    Wp-Mod.Com, Jan 10, 2010 IP
  2. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What do you get if you just use echo get_option('wp_show_featured');?

    Also, what are you trying to do and what do you mean it doesn't "execute well"?
     
    Altari, Jan 10, 2010 IP
  3. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    it is not a wordpress inbuilt function i am trying to call a featured gallery in my wordpress theme and the function was not working earlier but i found the solutions thnks anyway
     
    Wp-Mod.Com, Jan 10, 2010 IP
  4. kpmedia

    kpmedia Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Radio buttons for where and for what?
     
    kpmedia, Jan 10, 2010 IP
  5. pavelx

    pavelx Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Can you post a link to your website, so we can take a better look?
     
    pavelx, Jan 10, 2010 IP
  6. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    sorry i bit research and i found a solution my self

     
    Wp-Mod.Com, Jan 15, 2010 IP