Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/04/2012, 05:21
aleksinc
 
Fecha de Ingreso: diciembre-2011
Mensajes: 12
Antigüedad: 12 años, 4 meses
Puntos: 0
Pregunta Consulta BD Páginas

Hola muy buenas!

Tengo una duda que me esta haciendo querer saltar por mi ventana

Veamos, quiero hacer que una de mis páginas de wordpress, me de resultados de la misma forma que si pinchamos en una categoria peeeeero, los resultados quiero que sean ciertas páginas.

mis preguntas son:

Como hago ese codigo?
Como deberia hacer para denominar que ciertas paginas que vaya publicando, sean las que debe ir cogiendo de la base de datos conforme en el tiempo las publique??

me explico..
Tengo entendido que si quiero un tipo de pagina la cree con el codigo:

Cita:
<?php
/*
Template Name: Nombre de mi página
*/
?>
Esto para seleccionarla en el editor de wordpress... pero si quiero que lo coja como el estilo de "Categoria", deberia coger el Category.php y su php de estilos.
Quiero decir que tengo esto:



- Category.php
Cita:
<?php get_header(); ?>
<?php if (get_option('miblog_blog_style') == 'on') { get_template_part('includes/blogstylecat');
} else { get_template_part('includes/defaultcat'); } ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Que carga su pagina de "Defaultcat.php":

Cita:
<div id="post-top">
<div class="breadcrumb">
<?php if(function_exists('bcn_display')) { bcn_display(); }
else { ?>
<?php esc_html_e('You are currently viewing','miblog') ?>: <em><?php single_cat_title("") ?></em>
<?php }; ?>
</div> <!-- end breadcrumb -->
</div> <!-- end post-top -->

<div id="main-area-wrap">
<div id="wrapper">
<div id="main" class="noborder">
<?php $i = 0; if (have_posts()) : while (have_posts()) : the_post();
$i++; ?>

<?php $width = 291;
$height = 114;
$titletext = get_the_title();
$thumbnail = get_thumbnail($width,$height,'',$titletext,$titlet ext);
$thumb = $thumbnail["thumb"]; ?>

<div class="mainpost-wrap<?php if (($i%2)<>0) echo (" fst") ?>">
<h2><a href="<?php the_permalink() ?>" title="<?php printf(esc_attr__('Permanent Link to %s','miblog'), get_the_title()) ?>"><?php truncate_title(37); ?></a></h2>
<p><?php truncate_post(119); ?></p>

<?php if ( $thumb <> '' ) { ?>
<a href="<?php the_permalink() ?>" title="<?php printf(esc_attr__('Permanent Link to %s','miblog'), get_the_title()) ?>">
<?php print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height); ?>
</a>
<?php }; ?>

<div class="info"><em><?php esc_html_e('posted on','miblog') ?></em>: <?php the_time(get_option('miblog_date_format')) ?> | <em><?php esc_html_e('author','miblog') ?></em>: <?php echo get_the_author(); ?></div>
</div> <!-- end mainpost-wrap-->
<?php endwhile; ?>

<?php if( function_exists('wp_pagenavi') ) { wp_pagenavi(); }
else { ?>
<p class="pagination">
<?php next_posts_link(esc_html__('&laquo; Previous Entries','miblog')) ?>
<?php previous_posts_link(esc_html__('Next Entries &raquo;','miblog')) ?>
</p>
<?php } ?>

<?php else : ?>
<!--If no results are found-->
<div id="post-content">
<h1><?php esc_html_e('No Results Found','miblog') ?></h1>
<p><?php esc_html_e('The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.','miblog') ?></p>
</div>
<!--End if no results are found-->
<?php endif; ?>
</div> <!-- end main -->

Mi intencion es (creo que solución) hacer lo mismo mismo si quiero que me cargue igual la información, hacer un "mipagina.php" que cargue desde "defaultmipagina.php" como ocurre con category... pero quiero que sean paginas lo que cargue para despues entrar ya en ellas.

una vez solucionado esta parte, si se solucionase... como voy marcando las paginas para que ese php las cargue?? con el "Orden" ??

toda esa es mi gran duda.

:

Muchas gracias de antemano!

PD: ya he probado cosas.. me queda como ultimo recurso preguntar..