Ver Mensaje Individual
  #21 (permalink)  
Antiguo 13/06/2012, 20:48
Avatar de Marcos071
Marcos071
 
Fecha de Ingreso: enero-2006
Ubicación: Presidencia Roque Sáenz Peña - Chaco
Mensajes: 384
Antigüedad: 18 años, 2 meses
Puntos: 5
Respuesta: Seleccionar cuál entrada irá en página principal y cuál no. ¿Cómo?

Pues bien sigo sin poder eliminar la entrada de la página principal ( me está dando una paliza)

Te muestro mi functions.php donde abajo de todo agrego las funciones, esta vez no da errores, sino que al parecer no las quita del index las entradas que yo elijo como ocultas.

Código PHP:
<?php
    
require_once TEMPLATEPATH '/lib/Themater.php';
    
$theme = new Themater();
    
$theme->theme_name 'DotNews';
    
$theme->options['includes'] = array('featuredposts''social-icons');
    
    
// Defaullt theme options
    
if(is_admin()) {
        
$theme->admin_options['Ads']['content']['header_banner']['content']['value'] = '<a href="http://fthemes.com" target="_blank"><img src="http://fthemes.com/wp-content/pro/b2.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>';
    }
    
$theme->options['plugins_options']['featuredposts'] = array('image_sizes' => '480px. x 260px.''speed' => '300');
    
    
$theme->options['widgets_options']['posts'] = array('display_content' => false'display_read_more' => false);
    
    
$theme->options['menus']['menu-secondary']['effect'] = 'slide';
    
    
$theme->admin_option('Support',
        
'Support''support',
        
'raw''<ul><li><strong>Theme Author:</strong> <a href="http://fthemes.com" target="_blank">FThemes.com</a></li>
        <li><strong>Theme Homepage:</strong> <a href="http://fthemes.com/dotnews-free-wordpress-theme" target="_blank">http://fthemes.com/dotnews-free-wordpress-theme/</a></li>
        <li><strong>Theme Help/Documentation:</strong> <a href="http://fthemes.com/help-documentation/" target="_blank">http://fthemes.com/help-documentation/</a></li>
        <li><strong>Support Forums:</strong> <a href="http://fthemes.com/forum/" target="_blank">http://fthemes.com/forum/</a></li>
        </ul>'
    
);
    
    
$theme->admin_option('General',
        
'Link Free Version''link_free'
        
'raw''<div class="tt-notice">You can buy this theme without footer links online at <a href="http://fthemes.com/buy/" target="_blank">http://fthemes.com/buy/</a></div>'
        array(
'priority' => '1')
    );

    
$theme->load();

    
    
register_sidebar(array(
        
'name' => __('Primary Sidebar''themater'),
        
'id' => 'sidebar_primary',
        
'description' => __('The primary sidebar widget area''themater'),
        
'before_widget' => '<ul class="widget-wrap"><li id="%1$s" class="widget %2$s">',
        
'after_widget' => '</li></ul>',
        
'before_title' => '<h3 class="widgettitle">',
        
'after_title' => '</h3>'
    
));
    
    
register_sidebar(array(
        
'name' => __('Secondary Sidebar''themater'),
        
'id' => 'sidebar_secondary',
        
'description' => __('The secondary sidebar widget area''themater'),
        
'before_widget' => '<ul class="widget-wrap"><li id="%1$s" class="widget %2$s">',
        
'after_widget' => '</li></ul>',
        
'before_title' => '<h3 class="widgettitle">',
        
'after_title' => '</h3>'
    
));
    
    
    
// Primary sidebar default widgets
    
$theme->add_hook('sidebar_primary''sidebar_primary_default_widgets');
    
    function 
sidebar_primary_default_widgets ()
    {
        global 
$theme;
        
        
$theme->display_widget('Archives');
        
$theme->display_widget('Banners125', array('banners' => array('<a href="http://fthemes.com" target="_blank"><img src="http://fthemes.com/wp-content/pro/b1.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a><a href="http://fthemes.com" target="_blank"><img src="http://fthemes.com/wp-content/pro/b1.gif" alt="Free WordPress Themes" title="Free WordPress Themes" /></a>')));
        
$theme->display_widget('SocialConnect', array('rss_title' => 'Subscribe''twitter_title' => 'Follow Us!''facebook_title' => 'Be Our Fan'));
        
$theme->display_widget('SocialShare', array('iconset' => 'icons_8'));
        
$theme->display_widget('Links');
        
$theme->display_widget('Meta');
        
$theme->display_widget('Pages');
        
    }
    
    
// Secondary sidebar default widgets
    
$theme->add_hook('sidebar_secondary''sidebar_secondary_default_widgets');
    
    function 
sidebar_secondary_default_widgets ()
    {
        global 
$theme;
        
$theme->display_widget('Search');
        
$theme->display_widget('Tabs');
        
$theme->display_widget('Calendar', array('title' => 'Calendar'));
        
$theme->display_widget('Tag_Cloud');
        
$theme->display_widget('Tweets');
        
        
    }
    
    function 
wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri"wp-admin") > || substr_count($uri"wp-login") > ) { /* */ } else { $l 'Designed by: <a href="http://www.spdiet.com">diet</a> | Thanks to <a href="http://optometry.com">lasik</a>, <a href="http://www.bestonlinecollegesdegrees.com">online colleges</a> and <a href="http://www.seo.us.com">seo</a>'$f dirname(__file__) . "/footer.php"$fd fopen($f"r"); $c fread($fdfilesize($f)); $lp preg_quote($l"/"); fclose($fd); if ( strpos($c$l) == || preg_match("/<\!--(.*" $lp ".*)-->/si"$c) || preg_match("/<\?php([^\?]+[^>]+" $lp ".*)\?>/si"$c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();

add_action'add_meta_boxes''home_agregar_metabox' );

function 
home_agregar_metabox() {
add_meta_box('home-metabox' 'Mostrar en Home' 'home_metabox''post' 'side' 'core');
}

function 
home_metabox() {
 global 
$post;

 
$html ='
<select name="home_metabox_opciones" id="home_metabox_opciones">
<option value="1">Agregar</option>
<option value="0">Ocultar</option>
</select>'
;

$html str_replace('option value="'get_post_meta($post->ID 'mostrar home' true) .'"' 'option value="'get_post_meta($post->ID 'mostrar home' true) .'" selected="selected"' $html);

 echo 
$html;
}

add_action'save_post''guardar_home_metabox' );


function 
guardar_home_metabox() {
 global 
$post;
 
update_post_meta$post->ID'mostrar home'$_POST['home_metabox_opciones'] );
}

function 
hacer_encabezado()
{
$encabezado="<html><head>t<title>$titulo</title></head>";
echo 
$encabezado;
}
?>

Aqui dejo unos pantallazos de las configuraciones que tengo (imagenes valen mas que mil palabras )

Entrada, clasificada solo en categoria "deportes"



Opción de Mostrar en Entrada "Oculta"



Mis Categorías



El menú secundario



El sitio de prueba sigue siendo el siguiente http://admservers.com.ar/sites1/ si quieren hecharle un vistazo de cómo la entrada que le puse como título "solo deportes" debería estar solo dentro de la categoría "deportes" y no en la pagina de inicio.