• Rozwiązano jamesfloower

    (@jamesfloower)


    Witam.

    Stworzyłem podstronę 'portfolio’ i chciałbym ukryć/usunąć widgety na tej stronie, więc w pliku page.php za pomocą tego kodu – <?php is_page($page); ?> – wpisałem następująco:

    <?php if(!is_page(’portfolio’)){ get_sidebar(); } ?>

    niestety, strona odświeżyła się be zmian. Może mi ktoś powiedzieć co dokładnie źle robię?

    niżej podaję źródło pliku page.php

    <?php
    /**
    * The template for displaying all pages.
    */

    get_header(); ?>

    <div id=”container”>
    <div id=”content” role=”main”>

    <?php if(!is_page(’portfolio’)){ get_sidebar(); } ?>

    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <header>
    <?php if ( is_front_page() ) { ?>
    <h2 class=”entry-title”><?php the_title(); ?></h2>
    <?php } else { ?>
    <h1 class=”entry-title”><?php the_title(); ?></h1>
    <?php } ?>
    </header>

    <div class=”entry-content”>
    <?php the_content(); ?>
    <?php wp_link_pages( array( 'before’ => '<div class=”page-link”>’ . __( 'Pages:’, 'autofocus’ ), 'after’ => '</div>’ ) ); ?>
    <?php edit_post_link( __( 'Edit’, 'autofocus’ ), '<span class=”edit-link”>’, '</span>’ ); ?>
    </div><!– .entry-content –>

    <footer class=”entry-utility”>
    <?php get_sidebar(); ?>
    </footer>

    </article><!– #post-## –>

    <?php
    // Only show the Comments Form if the post has comments open
    if ( comments_open() || get_comments_number() != '0′ ) {
    comments_template( ”, true );
    }
    ?>

    <?php endwhile; ?>

    </div><!– #content –>

    </div><!– #container –>

    <?php get_footer(); ?>

Zobacz 6 odpowiedzi - od 1 do 6 (z 6 łącznie)
Zobacz 6 odpowiedzi - od 1 do 6 (z 6 łącznie)

Temat ‘Usunięcie sidebar dla pojedyńczej podstrony’ jest zamknięty na nowe odpowiedzi.