Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/02/2013, 15:37
guns1987
 
Fecha de Ingreso: octubre-2008
Ubicación: Santiago de Surco - Lima - Peru
Mensajes: 39
Antigüedad: 16 años, 2 meses
Puntos: 1
Respuesta: Insertar pagina dentro de un arreglo

este es el codigo
Código PHP:

$home_tabs = array(

    'news' => array('title' => __('News', 'msm'), 'query' => array('post_type' => 'post', 'category_name'=>'Noticias', 'showposts' => 3), 'viewmore' => get_permalink(get_option('page_for_posts'))),
    
    'doc_oficiales' => array('title' => __('Documentos Oficiales', 'msm'), 'query' => array('post_type' => 'page', 'name'=>'doc_oficiales')),
    'galeria' => array('title' => __('Galeria Fotográfica', 'msm'), 'query' => array('post_parent'=>'1424', 'post_type' => 'page', 'showposts' => 3), 'viewmore' => get_permalink(1424))
    ,'videos' => array('title' => __('Videos', 'msm'), 'query' => array('post_type' => 'post', 'category_name'=>'Videos' , 'showposts' => 3), 'viewmore' => get_permalink(1271))    
);


?>
<div id="home-tabs">        
    <ul>
        <?php foreach ($home_tabs as $key => $tab): ?>
            <li><a href="#home-<?php echo $key?>"><?php echo $tab['title']; ?></a></li>            
        <?php endforeach; ?>
    </ul>
    <?php 
    
foreach ($home_tabs as $key => $tab): ?>
        <div id="home-<?php echo $key?>" class="home-posts" >
            <?php if($key == 'official_documents'): ?>
            <div id="home-attachments-filter" >
                <?php foreach($media_terms as $key => $term): ?>
                <a class="<?php echo ($key == 0) ? 'active' ''?>" href="<?php echo get_term_link($term); ?>"><?php echo $term->name?></a>
                <?php endforeach; ?>
            </div>
            <?php endif; ?>
            <a class="home-posts-viewmore" href="<?php echo $tab['viewmore']; ?>"><?php echo ucfirst(strtolower(sprintf(__('Previous %s''msm'), $tab['title']))); ?></a>
            <div class="clear"></div>
            <div class="home-posts-list" >
            <?php
            
            $home_query 
= new WP_Query($tab['query']); 
        
            
?>
            <?php while ($home_query->have_posts()): $home_query->the_post(); ?>
                <?php global $post?>
                <?php 
            
                
if($post->post_type == 'post'): ?>
                <div class="post home-post" style="border-bottom:#E2E2E2 solid 2px;  ">
                    <div><time><?php echo get_the_date(__('l jS F, Y''msm')); ?></time></div>
                    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                    <div class="home-post-entry">
                        <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>            
                        <?php the_excerpt(); ?>
                    </div>
                   <a style="margin-bottom:5px" class="viewmore" href="<?php the_permalink(); ?>"><?php _e('View more''msm'); ?></a>
                </div>
                      

                <?php  
                
elseif($post->post_type == 'attachment'): 
                
?>
                <div class="attachment home-attachment">
                    <?php $filepath wp_get_attachment_url($post->ID); $extension end(explode('.'$filepath)); ?>
                    <a class="download" target="_blank" href="<?php echo $filepath?>">
                        <span style="background-image:url('<?php bloginfo('template_directory'); ?>/images/documents/<?php echo substr($extension03); ?>.png')"><?php printf(__('Download the %s file''msm'), strtoupper($extension)); ?></span>
                    </a>
                    <time><?php echo get_the_date(__('l jS F, Y''msm')); ?></time>
                    <h1><a href="<?php echo $filepath?>"><?php the_title(); ?></a></h1>
                </div>
                
                
                <?php 
                
elseif($post->post_type == 'page'): 
                
?>
                <div class="post home-post">
                    <time><?php echo get_the_date(__('l jS F, Y''msm')); ?></time>
                    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a>
                    <div class="home-post-entry">
                        <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>            
                        <?php the_excerpt(); ?>
                    </div>
                   <a class="viewmore" href="<?php the_permalink(); ?>"><?php _e('View more''msm'); ?></a>
                   
                </div>
                <hr style="border:#E2E2E2 solid 1px">
                
                
                <?php else: ?>
                
                PROBANDO
                
                <?php endif; ?>
            <?php endwhile; ?>
            </div>
            <?php wp_reset_postdata(); ?>
        </div>
    <?php endforeach;

     
?>
</div>