Excluindo uma cartegoria
-
Bom dia!
Achei alguns tutoriais para excluir uma categoria, mas no meu caso não resolveu.
O código da minha page.php é assim:<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
include (TEMPLATEPATH . ‘/loop.php’);
endwhile;
endif;
get_footer();
?>Coloquei certa vez um código que encontrei no functions.php, funcionou mas os comentários não funcionava.
Me ajudem, por favor!
-
Na verdade, eu entrei nesse tutorial: http://br.forums.wordpress.org/topic/excluir-categoria-apenas-da-pagina-principal
E parece funcionar, mas não sei onde colocar o código no meu functions.php
que é este:
<?php load_theme_textdomain( 'dld_theme', TEMPLATEPATH . '/languages' ); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); remove_action('wp_head', 'wp_generator'); add_filter('show_admin_bar', '__return_false'); add_filter('widget_text', 'do_shortcode'); function dld_fancybox() { echo "<script type=\"text/javascript\" src=\""; ?><?php bloginfo('template_url'); ?><?php echo "/fancybox/jquery.fancybox-1.3.4.pack.js\"></script>"; echo "<script type=\"text/javascript\" src=\""; ?><?php bloginfo('template_url'); ?><?php echo "/fancybox/jquery.mousewheel-3.0.4.pack.js\"></script>"; echo "<link rel=\"stylesheet\" href=\""; ?><?php bloginfo('template_url'); ?><?php echo "/fancybox/jquery.fancybox-1.3.4.css\" type=\"text/css\" media=\"screen\">\n"; echo "<script type=\"text/javascript\">jQuery.noConflict(); jQuery(function(){ var thumbnails = 'a:has(img)[href$=\".bmp\"],a:has(img)[href$=\".gif\"],a:has(img)[href$=\".jpg\"],a:has(img)[href$=\".jpeg\"],a:has(img)[href$=\".png\"],a:has(img)[href$=\".BMP\"],a:has(img)[href$=\".GIF\"],a:has(img)[href$=\".JPG\"],a:has(img)[href$=\".JPEG\"],a:has(img)[href$=\".PNG\"]'; var posts = jQuery('.post'); posts.each(function() { jQuery(this).find(thumbnails).addClass(\"fancybox\").attr('rel','fancybox'+posts.index(this)) }); jQuery(\"a.fancybox\").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'inside', 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return '<span id=\"fancybox-title-inside\">Imagem ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' - ' + title : '') + '</span>'; } }); });</script>\n"; } register_nav_menus( array( 'primary' => __( 'Header Menu', 'dld_theme' ), ) ); function dldwp_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'dldwp_page_menu_args' ); function blog_widgets_init() { register_sidebar( array( 'name' => 'Sidebar 1', 'id' => 'sidebar-1', 'description' => 'Sidebar 1', 'before_widget' => ' <!--widget--><div id="%1$s" class="widget %2$s">', 'after_widget' => '<div class="both"></div> </div> <div class="both"></div><!--//widget--> ', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>', ) ); register_sidebar( array( 'name' => 'Sidebar 2', 'id' => 'sidebar-2', 'description' => 'Sidebar 2', 'before_widget' => ' <!--widget--><div id="%1$s" class="widget-other %2$s">', 'after_widget' => '<div class="both"></div> </div> <div class="both"></div><!--//widget--> ', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>', ) ); register_sidebar( array( 'name' => 'Footer 1', 'id' => 'footer-1', 'description' => 'Footer 1', 'before_widget' => ' <!--widget--><div id="%1$s" class="widget %2$s">', 'after_widget' => '<div class="both"></div> </div> <div class="both"></div><!--//widget--> ', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>', ) ); register_sidebar( array( 'name' => 'Footer 2', 'id' => 'footer-2', 'description' => 'Footer 2', 'before_widget' => ' <!--widget--><div id="%1$s" class="widget %2$s">', 'after_widget' => '<div class="both"></div> </div> <div class="both"></div><!--//widget--> ', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>', ) ); register_sidebar( array( 'name' => 'Footer 3', 'id' => 'footer-3', 'description' => 'Footer 3', 'before_widget' => ' <!--widget--><div id="%1$s" class="widget %2$s">', 'after_widget' => '<div class="both"></div> </div> <div class="both"></div><!--//widget--> ', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>', ) ); register_sidebar( array( 'name' => 'Footer 4', 'id' => 'footer-4', 'description' => 'Footer 4', 'before_widget' => ' <!--widget--><div id="%1$s" class="widget %2$s">', 'after_widget' => '<div class="both"></div> </div> <div class="both"></div><!--//widget--> ', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'blog_widgets_init' ); function dld_related_posts() { $relatedcat = get_option('simplethird_relatedposts'); if ($relatedcat == 'Tags') { dld_related_tags(); } elseif ($relatedcat == 'Hide') { } else { dld_related_cat(); } } function dld_related_tags() { $orig_post = $post; global $post; $tags = wp_get_post_tags($post->ID); $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'posts_per_page'=> 5, 'caller_get_posts'=> 1 ); $my_query = new wp_query( $args ); if( $my_query->have_posts() ) { echo "<ul class=\"related-posts\">\n"; echo "<h3>". __( 'Related Posts', 'dld_theme' )."</h3>\n"; while( $my_query->have_posts() ) { $my_query->the_post(); ?> <li><a>" title="<?php the_title(); ?>"><?php if( has_post_thumbnail() ) { the_post_thumbnail( array(120,120) ); } else { ?><img src="<?php echo dld_thumb('thumbnail'); ?>" alt=""><?php } ?><?php the_title(); ?></a></li> <?php } echo "<div style=\"clear:both;\"></div> \n"; } $post = $orig_post; wp_reset_query(); } function dld_related_cat() { $orig_post = $post; global $post; $categories = get_the_category($post->ID); $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'category__in' => $category_ids, 'post__not_in' => array($post->ID), 'posts_per_page'=> 5, 'caller_get_posts'=> 1 ); $my_query = new wp_query( $args ); if( $my_query->have_posts() ) { echo "<ul class=\"related-posts\">\n"; echo "<h3>". __( 'Related Posts', 'dld_theme' )."</h3>\n"; while( $my_query->have_posts() ) { $my_query->the_post(); ?> <li><a>" title="<?php the_title(); ?>"><?php if( has_post_thumbnail() ) { the_post_thumbnail( array(120,120) ); } else { ?><img src="<?php echo dld_thumb('thumbnail'); ?>" alt=""><?php } ?><?php the_title(); ?></a></li> <?php } echo "<div style=\"clear:both;\"></div> \n"; } $post = $orig_post; wp_reset_query(); } function dld_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == ''){ global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages){$pages = 1;} } if(1 != $pages){ echo "<div class=\"pagination\">"; echo "<span class=\"pages\">".__( 'Page ', 'dld_theme' ).$paged." de ".$pages."</span>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>« ". __( 'Previous', 'dld_theme' )."</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class=\"current\">".$i."</span>":"<a href='".get_pagenum_link($i)."'>".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a>". __( 'Next', 'dld_theme' )." »</a>"; echo "</div>\n"; } } function dld_share() { echo "<span class=\"dld-share\">\n"; echo " <span class=\"share-twitter\"><a href="http://twitter.com/share"><?php the_permalink();?><?php echo "\" data-text=\"";?><?php the_title(); ?><?php echo "\" data-count=\"horizontal\">Tweet</a><script type=\"text/javascript\" src=\"http://platform.twitter.com/widgets.js\"></script></span>\n"; echo " <span class=\"share-plusone\"><g:plusone size=\"medium\" href=\""; ?><?php the_permalink();?><?php echo "\"></g:plusone></span>\n"; echo " <span class=\"share-facebook\"><iframe src=\"http://www.facebook.com/plugins/like.php?href="; ?><?php the_permalink();?><?php echo "&layout=button_count&show_faces=false&width=85&action=like&colorscheme=light&height=21\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:85px; height:21px;\" allowTransparency=\"true\"></iframe></span>\n"; echo "<div style=\"clear:both;\"></div> </span>\n"; } function dld_facebook_thumb() {global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; return $first_img;} function dld_facebook_header() { if( is_single() ) : echo "<meta property=\"og:title\" content=\""?><?php the_title(); ?><?php echo "\">\n"; echo "<meta property=\"og:type\" content=\"article\">\n"; echo "<meta property=\"og:url\" content=\""?><?php the_permalink(); ?><?php echo "\">\n"; echo "<meta property=\"og:image\" content=\""?><?php if (dld_facebook_thumb()) { echo dld_facebook_thumb(); } else { ?><?php bloginfo('template_directory'); ?>/i/facebook-thumb.png<?php }?><?php echo "\">\n"; else : echo "<meta property=\"og:image\" content=\""?><?php bloginfo('template_directory'); ?><?php echo "/i/facebook-thumb.png\">\n"; endif; } add_filter('get_comments_number', 'dld_comment_count', 0); function dld_comment_count( $count ) { global $id; $comments_by_type = &separate_comments(get_comments('post_id=' . $id)); return count($comments_by_type['comment']); } function dld_list_pings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?><span><?php comment_date('d m y'); ?></span> <?php } function dld_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li id="comment-<?php comment_ID() ?>"> <div id="div-comment-<?php comment_ID() ?>" <?php comment_class(); ?>> <?php echo get_avatar($comment, 50, ''); ?> <div class="comment-content the-content"> <p class="comment-author"><strong><?php comment_author_link(); ?></strong> <em class="comment-date"><?php printf( get_comment_time('d F Y')) ?><?php edit_comment_link(__('{Edit}', 'dld_theme'),' ','') ?></p> <?php if ($comment->comment_approved == '0') : ?><p><em><?php _e('Your comment will appear after being approved by admin.', 'dld_theme') ?></em></p><?php endif; ?><?php comment_text() ?> <?php comment_reply_link(array_merge( $args, array('reply_text' => __('Reply', 'dld_theme'), 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div> </div> <?php } function dld_comment_form(){ global $user_identity, $id; if ( ! comments_open() ) : ?> <div class="nocomments"><p><?php _e("Comments Closed", "dld_theme"); ?></p></div> <?php elseif (comments_open()) : //Comment Form ?> <div id="respond" class="comment-form"> <h3><?php comment_form_title( __( 'Leave a Comment', 'dld_theme' ), __( 'Leave a Reply to %s', 'dld_theme' ) ); ?></h3> <p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p class="comment-loggedin"><?php _e("You have to be", "dld_theme"); ?> <a>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>"><?php _e("logged in", "dld_theme"); ?></a> <?php _e("to be able to comment.", "dld_theme"); ?></p> <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="comment-form"> <?php if ( is_user_logged_in() ) : ?> <p><a>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a>" title="Log out of this account">Log out »</a></p> <?php else : ?> <p><label><?php _e("Name", "dld_theme"); ?><span>*</span></label><input type="text" name="author" class="comment-input" id="author" size="22" tabindex="1" <?php if (isset($req)) echo "aria-required='true'"; ?> /></p> <p><label><?php _e("Email", "dld_theme"); ?><span>*</span></label><input type="text" name="email" class="comment-input" id="email" size="22" tabindex="2" <?php if (isset($req)) echo "aria-required='true'"; ?> /></p> <p><label><?php _e("Website", "dld_theme"); ?></label><input type="text" name="url" class="comment-input" id="url" size="22" tabindex="3"/></p> <?php endif; ?> <p id="comment-textarea-wrapper"> <label><?php _e("Message", "dld_theme"); ?><span>*</span></label> <textarea name="comment" id="comment" rows="10" tabindex="4"></textarea> </p> <p id="required-field"><?php _e("<span>*</span> Required Field", "dld_theme"); ?></p> <p> <input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e("Send", "dld_theme"); ?>" /> <?php comment_id_fields(); ?> </p> <?php do_action('comment_form', isset($post->ID)); ?> </form> <?php endif;// If registration required and not logged in ?> <div class="clear"></div> </div><!--#respond--> <?php endif; } function youtube_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'video' => '', 'width' => '600', 'height' => '370' ), $atts)); return '<div class="video youtube-video"><iframe src="http://www.youtube.com/embed/'.$video.'" width="'.$width.'" height="'.$height.'" frameborder="0" allowfullscreen></iframe></div>'; } add_shortcode('youtube', 'youtube_shortcode'); function add_button_youtube() { if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) return; if ( get_user_option('rich_editing') == 'true') { add_filter('mce_external_plugins', 'add_buttonyoutube_tinymce_plugin'); add_filter('mce_buttons', 'register_button_youtube'); } } add_action('init', 'add_button_youtube'); function register_button_youtube($buttons) { array_push($buttons, "|", "youtube"); return $buttons; } function add_buttonyoutube_tinymce_plugin($plugin_array) { $plugin_array['youtube'] = get_bloginfo('template_url').'/js/mybuttons.js'; return $plugin_array; } function vimeo_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'video' => '', 'width' => '600', 'height' => '370' ), $atts)); return '<div class="video vimeo-video"><iframe src="http://player.vimeo.com/video/'.$video.'?title=0&byline=0&portrait=0" width="'.$width.'" height="'.$height.'" frameborder="0"></iframe></div>'; } add_shortcode('vimeo', 'vimeo_shortcode'); function add_button_vimeo() { if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) return; if ( get_user_option('rich_editing') == 'true') { add_filter('mce_external_plugins', 'add_buttonvimeo_tinymce_plugin'); add_filter('mce_buttons', 'register_button_vimeo'); } } add_action('init', 'add_button_vimeo'); function register_button_vimeo($buttons) { array_push($buttons, "|", "vimeo"); return $buttons; } function add_buttonvimeo_tinymce_plugin($plugin_array) { $plugin_array['vimeo'] = get_bloginfo('template_url').'/js/mybuttons.js'; return $plugin_array; } add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 100, 63 ); add_image_size( 'large_thumb', 90, 90, true ); add_image_size( 'small_thumb', 75, 75, true ); function dld_thumb($size = "medium", $add = ""){ global $wpdb, $post; $thumb = $wpdb->get_row("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_parent = {$post->ID} AND post_mime_type LIKE 'image%' ORDER BY menu_order"); if(!empty($thumb)){ $image = image_downsize($thumb->ID, $size); print "{$image[0]}"; } else { print get_bloginfo('template_directory')."/i/thumbnail.png"; } } function dld_excerpt($limit) { $excerpt = explode(' ', get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).'...'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('<code>\[[^\]]*\]</code>','',$excerpt); return $excerpt; } function dld_content($limit) { $content = explode(' ', get_the_content(), $limit); if (count($content)>=$limit) { array_pop($content); $content = implode(" ",$content).'...'; } else { $content = implode(" ",$content); } $content = preg_replace("/<img[^>]+\>/i", "", $content); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); return $content; } add_filter('gallery_style', create_function( '$css', 'return preg_replace("#<style type=\'text/css\'>(.*?)</style>#s", "", $css);' ) ); add_shortcode('wp_caption', 'fixed_img_caption_shortcode'); add_shortcode('caption', 'fixed_img_caption_shortcode'); function fixed_img_caption_shortcode($attr, $content = null) { $output = apply_filters('img_caption_shortcode', '', $attr, $content); if ( $output != '' ) return $output; extract(shortcode_atts(array( 'id'=> '', 'align' => 'alignnone', 'width' => '', 'caption' => ''), $attr)); if ( 1 > (int) $width || empty($caption) ) return $content; if ( $id ) $id = 'id="' . esc_attr($id) . '" '; return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '">' . do_shortcode( $content ) . '<p class="wp-caption-text">' . $caption . '</p></div>'; } function dld_remove_recent_comments_style() { add_filter( 'show_recent_comments_widget_style', '__return_false' ); } add_action( 'widgets_init', 'dld_remove_recent_comments_style' ); function dld_remove_widgets() { unregister_widget( 'WP_Widget_Meta' ); unregister_widget( 'WP_Widget_Pages' ); unregister_widget( 'WP_Widget_Search' ); } add_action( 'widgets_init', 'dld_remove_widgets' ); function mySearchPostsFilter($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','mySearchPostsFilter'); /* * ========================== * theme options by difluir * ========================== */ $themename = "Simple Third"; $shortname = "simplethird"; $options = array ( array( "name" => $themename." Options", "type" => "title"), /* general */ array( "name" => __('General', 'dld_theme'), "type" => "section"), array( "type" => "open"), array( "name" => __('Custom Favicon', 'dld_theme'), "desc" => __('A favicon is a 16x16 pixel icon that represents your site; paste the URL to a .ico or .png image that you want to use as the image', 'dld_theme'), "id" => $shortname."_favicon", "type" => "text", "std" => get_bloginfo('template_url')."/i/favicon.png" ), array( "name" => __('Feedburner URL', 'dld_theme'), "desc" => __('Feedburner is a Google service that takes care of your RSS feed. Paste your Feedburner URL here to let readers see it in your website', 'dld_theme'), "id" => $shortname."_feedburner", "type" => "text", "std" => get_bloginfo('rss2_url') ), array( "name" => __('Google Analytics Code', 'dld_theme'), "desc" => __('You can paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer', 'dld_theme'), "id" => $shortname."_ga_code", "type" => "textarea", "std" => "" ), array( "name" => __('Custom CSS', 'dld_theme'), "desc" => __('Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: a.button{color:#000;}', 'dld_theme'), "id" => $shortname."_custom_css", "type" => "textarea", "std" => "" ), array( "type" => "close"), /* Posts */ array( "name" => __('Posts', 'dld_theme'), "type" => "section"), array( "type" => "open"), array( "name" => __('Related Posts', 'dld_theme'), "desc" => __('Select how the theme will show the related posts', 'dld_theme'), "id" => $shortname."_relatedposts", "type" => "select", "options" => array( "Categories", "Tags", "Hide" ), "std" => "Categories" ), array( "type" => "close"), ); function dldtheme_add_admin() { global $themename, $shortname, $options; if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } foreach ($options as $value) { if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } header("Location: admin.php?page=functions.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) {delete_option( $value['id'] );} header("Location: admin.php?page=functions.php&reset=true"); die; } } add_theme_page($themename, $themename, 'edit_themes', basename(__FILE__), 'dldtheme_admin'); } function dldtheme_add_init() { $file_dir=get_bloginfo('template_directory'); wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all"); } function dldtheme_admin() { global $themename, $shortname, $options; $i=0; if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>'; if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>'; ?> <div class="wrap dld_wrap"> <h2><?php echo $themename; ?> <?php _e("Settings", "dld_theme"); ?></h2> <div class="dld_opts"> <form method="post"> <?php foreach ($options as $value) { switch ( $value['type'] ) { case "open": ?> <?php break; case "close": ?> </div> </div> <?php break; case "title": ?> <p><?php _e("To easily use the", "dld_theme"); ?> <?php echo $themename;?> <?php _e("theme, you can use the menu below.", "dld_theme"); ?></p> <?php break; case 'text': ?> <div class="dld_input dld_text"> <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label> <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id']) ); } else { echo $value['std']; } ?>" /> <small><?php echo $value['desc']; ?></small> <div class="clear"></div> </div> <?php break; case 'textarea': ?> <div class="dld_input dld_textarea"> <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label> <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id']) ); } else { echo $value['std']; } ?></textarea> <small><?php echo $value['desc']; ?></small> <div class="clear"></div> </div> <?php break; case 'select': ?> <div class="dld_input dld_select"> <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label> <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?> <option <?php if (get_settings( $value['id'] ) == $option) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option> <?php } ?></select> <small><?php echo $value['desc']; ?></small> <div class="clear"></div> </div> <?php break; case "checkbox": ?> <div class="dld_input dld_checkbox"> <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label> <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?> <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> /> <small><?php echo $value['desc']; ?></small> <div class="clear"></div> </div> <?php break; case "section": $i++; ?> <div class="dld_section"> <div class="dld_title"> <h3><?php echo $value['name']; ?></h3> <span class="submit"><input name="save<?php echo $i; ?>" type="submit" value="<?php _e("Save changes", "dld_theme"); ?>" /></span> <div class="clear"></div> </div> <div class="dld_options"> <?php break; } } ?> <input type="hidden" name="action" value="save" /> </form> <form method="post"><p class="submit"><input name="reset" type="submit" value="<?php _e("Reset", "dld_theme"); ?>" /><input type="hidden" name="action" value="reset" /></p></form> <div style="font-size:9px; margin-bottom:10px;">Theme by <a href="http://difluir.com">Difluir</a></div> </div> <?php } add_action('admin_init', 'dldtheme_add_init'); add_action('admin_menu', 'dldtheme_add_admin'); ?>
Olá lucicaroline;
Para excluir uma categoria do Menu:
<?php wp_list_categories('title_li=&orderby=name&exclude=1'); ?>
O exclude=1, exclui a categoria de ID 1 do menu
Para definir a categoria específica do Loop:
<?php $recent = new WP_Query("cat=1"); while($recent->have_posts()) : $recent->the_post();?>
Só pegará POsts da categoria 1 …
è isso que precisa?
Bjs
- O tópico ‘Excluindo uma cartegoria’ está fechado para novas respostas.