Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2012
    Messaggi
    26

    [Wordpress 3.6] Modificare il file home.php

    Ciao a tutti,
    vorrei modificare il file home.php affinché mostri nella front page gli ultimi 6 post. Ho provato dal pannello di amministrazione ma non funziona. Quindi suppongo di dover mettere mano al codice php.

    Qualcuno sa dirmi quali file devo modificare e qual è il giusto codice?

    Io ho modificato, senza risultati, il file home.php in questo modo:
    Codice PHP:
    <?php get_header(); ?>
                <?php get_sidebar('top'); ?>
                <?php
                
    if (have_posts()) {
                    
    /* Display navigation to next/previous pages when applicable */
                    
    if (theme_get_option('theme_' . (theme_is_home() ? 'home_' '') . 'top_posts_navigation')) {
                        
    theme_page_navigation();
                    }
                    
    ?>
    <div class="content-layout">
        <div class="content-layout-row">
        <div class="layout-cell" style="width: 50%" >
            <?php theme_get_next_post(); ?>
        </div><div class="layout-cell" style="width: 50%" >
            <?php theme_get_next_post(); ?>
        </div>
        </div>
    </div>
    <div class="content-layout">
        <div class="content-layout-row">
        <div class="layout-cell" style="width: 50%" >
            <?php theme_get_next_post(); ?>
        </div><div class="layout-cell" style="width: 50%" >
            <?php theme_get_next_post(); ?>
        </div>
        </div>
    </div>
    <div class="content-layout">
        <div class="content-layout-row">
        <div class="layout-cell" style="width: 50%" >
            <?php theme_get_next_post(); ?>
        </div><div class="layout-cell" style="width: 50%" >
            <?php theme_get_next_post(); ?>
        </div>
        </div>
    </div>

                    <?php
                    
    /* Display navigation to next/previous pages when applicable */
                    
    if (theme_get_option('theme_bottom_posts_navigation')) {
                        
    theme_page_navigation();
                    }
                } else {
                    
    theme_404_content();
                }
                
    ?>
                <?php get_sidebar('bottom'); ?>
    <?php get_footer
    (); ?>
    Il template è stato creato con Artisteer 4.

    Grazie a chiunque sia in grado di aiutarmi!!!

  2. #2
    Utente di HTML.it L'avatar di homerbit
    Registrato dal
    Dec 2005
    residenza
    Roma
    Messaggi
    1,380
    come vedi questo file non contiene nessuna funzione responsabile della visualizzazione articoli
    devi cercare il file che gestisce il loop che verrà inserito nella home
    ciao
    If you think your users are idiots, only idiots will use it. DropBox

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2012
    Messaggi
    26

    Index.php

    Quote Originariamente inviata da homerbit Visualizza il messaggio
    come vedi questo file non contiene nessuna funzione responsabile della visualizzazione articoli
    devi cercare il file che gestisce il loop che verrà inserito nella home
    ciao
    Questo è il loop? Sai come dovrei modificarlo?

    Codice PHP:
    <?php get_header(); ?>
                <?php get_sidebar('top'); ?>
                <?php
                
    if (have_posts()) {
                    
    /* Display navigation to next/previous pages when applicable */
                    
    if (theme_get_option('theme_' . (theme_is_home() ? 'home_' '') . 'top_posts_navigation')) {
                        
    theme_page_navigation();
                    }
                    
    /* Start the Loop */
                    
    while (have_posts()) {
                        
    the_post();
                        
    get_template_part('content'get_post_format());
                    }
                    
    /* Display navigation to next/previous pages when applicable */
                    
    if (theme_get_option('theme_bottom_posts_navigation')) {
                        
    theme_page_navigation();
                    }
                } else {
                    
    theme_404_content();
                }
                
    ?>
                <?php get_sidebar('bottom'); ?>
    <?php get_footer
    (); ?>

  4. #4
    Utente di HTML.it L'avatar di homerbit
    Registrato dal
    Dec 2005
    residenza
    Roma
    Messaggi
    1,380
    If you think your users are idiots, only idiots will use it. DropBox

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2012
    Messaggi
    26
    Grazieeeeeeeeee! Risolto

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.