Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] Problem z dodaniem wysuwanego menu.
Forum PHP.pl > Forum > Przedszkole
MrExeqtor
Witam

Od jakiegoś tygodnia buduję szablon swojego bloga.
Postanowiłem, że po prawej stronie będą wysuwane panele z tekstem.

Tutaj jest kod php:
  1. <?php
  2. echo "<div id=\"panel\">\n";
  3. echo " \n";
  4. echo " <div id=\"title\">\n";
  5. echo " Panel\n";
  6. echo " </div>\n";
  7. echo " \n";
  8. echo " <div id=\"content\">\n";
  9. echo " Jakaś zawartość\n";
  10. echo " </div>\n";
  11. echo " \n";
  12. echo "</div>\n";
  13. echo "\n";
  14. echo "<div id=\"panel1\">\n";
  15. echo " \n";
  16. echo " <div id=\"title\">\n";
  17. echo " Panel\n";
  18. echo " </div>\n";
  19. echo " \n";
  20. echo " <div id=\"content\">\n";
  21. echo " Jakaś zawartość\n";
  22. echo " </div>\n";
  23. echo " \n";
  24. echo "</div>\n";
  25. echo "\n";
  26. echo "<div id=\"panel2\">\n";
  27. echo " \n";
  28. echo " <div id=\"title\">\n";
  29. echo " Panel\n";
  30. echo " </div>\n";
  31. echo " \n";
  32. echo " <div id=\"content\">\n";
  33. echo " Jakaś zawartość\n";
  34. echo " </div>\n";
  35. echo " \n";
  36. echo "</div>\n";
  37. ?>


Oczywiście wszystko opiera się na stylu CSS.

Na stronie głównej wszystko działa: http://sezamowy.esy.es
Na stronach archiwum też: http://sezamowy.esy.es/2014/08/
Lecz na stronie pojedynczego wpisu, już nie: http://sezamowy.esy.es/2014/08/nnh/

Tutaj jest szablon strony pojedynczego wpisu:
  1. <?php get_header(); ?>
  2.  
  3. <div class="content">
  4. <?php tie_breadcrumbs() ?>
  5.  
  6.  
  7. <?php if ( ! have_posts() ) : ?>
  8. <div id="post-0" class="post not-found post-listing">
  9. <h1 class="post-title"><?php _e( 'Not Found', 'tie' ); ?></h1>
  10. <div class="entry">
  11. <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'tie' ); ?></p>
  12. <?php get_search_form(); ?>
  13. </div>
  14. </div>
  15. <?php endif; ?>
  16.  
  17. <?php while ( have_posts() ) : the_post(); ?>
  18.  
  19. <?php $get_meta = get_post_custom($post->ID);
  20. if( !empty( $get_meta['tie_review_position'][0] ) ){
  21. $review_position = $get_meta['tie_review_position'][0] ;
  22. $rv = $tie_reviews_attr;
  23. }
  24.  
  25. $post_width = $get_meta["tie_sidebar_pos"][0];
  26. if( $post_width == 'full' ) $content_width = 955;
  27. ?>
  28.  
  29. <?php //Above Post Banner
  30. if( empty( $get_meta["tie_hide_above"][0] ) ){
  31. if( !empty( $get_meta["tie_banner_above"][0] ) ) echo '<div class="ads-post">' .htmlspecialchars_decode($get_meta["tie_banner_above"][0]) .'</div>';
  32. else tie_banner('banner_above' , '<div class="ads-post">' , '</div>' );
  33. }
  34. ?>
  35.  
  36. <article <?php if( !empty( $rv['review'] ) ) echo $rv['review']; post_class('post-listing'); ?>>
  37. <?php get_template_part( 'includes/post-head' ); ?>
  38.  
  39. <div class="post-inner">
  40. <h1 class="name post-title entry-title" itemprop="itemReviewed" itemscope itemtype="http://schema.org/Thing"><span itemprop="name"><?php the_title(); ?></span></h1>
  41.  
  42. <?php get_template_part( 'includes/post-meta' ); ?>
  43.  
  44. <div class="entry">
  45. <?php if( ( tie_get_option( 'share_post_top' ) && empty( $get_meta["tie_hide_share"][0] ) ) || $get_meta["tie_hide_share"][0] == 'no' ) get_template_part( 'includes/post-share' ); // Get Share Button template ?>
  46. <?php if( !empty( $review_position ) && ( $review_position == 'top' || $review_position == 'both' ) ) tie_get_review('review-top'); ?>
  47.  
  48. <?php the_content(); ?>
  49. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'tie' ), 'after' => '</div>' ) ); ?>
  50.  
  51. <?php if( !empty( $review_position ) && ( $review_position == 'bottom' || $review_position == 'both' ) ) tie_get_review('review-bottom'); ?>
  52.  
  53. <?php edit_post_link( __( 'Edit', 'tie' ), '<span class="edit-link">', '</span>' ); ?>
  54. </div><!-- .entry /-->
  55. <?php the_tags( '<span style="display:none">',' ', '</span>'); ?>
  56. <span style="display:none" class="updated"><?php the_time( 'Y-m-d' ); ?></span>
  57. <?php if ( get_the_author_meta( 'google' ) ){ ?>
  58. <div style="display:none" class="vcard author" itemprop="author" itemscope itemtype="http://schema.org/Person"><strong class="fn" itemprop="name"><a href="<?php the_author_meta( 'google' ); ?>?rel=author">+<?php echo get_the_author(); ?></a></strong></div>
  59. <?php }else{ ?>
  60. <div style="display:none" class="vcard author" itemprop="author" itemscope itemtype="http://schema.org/Person"><strong class="fn" itemprop="name"><?php the_author_posts_link(); ?></strong></div>
  61. <?php } ?>
  62.  
  63. <?php if( ( tie_get_option( 'share_post' ) && empty( $get_meta["tie_hide_share"][0] ) ) || $get_meta["tie_hide_share"][0] == 'no' ) get_template_part( 'includes/post-share' ); // Get Share Button template ?>
  64.  
  65. </div><!-- .post-inner -->
  66. </article><!-- .post-listing -->
  67. <?php if( tie_get_option( 'post_tags' ) ) the_tags( '<p class="post-tag">'.__( 'Tagged with: ', 'tie' ) ,' ', '</p>'); ?>
  68.  
  69.  
  70. <?php //Below Post Banner
  71. if( empty( $get_meta["tie_hide_below"][0] ) ){
  72. if( !empty( $get_meta["tie_banner_below"][0] ) ) echo '<div class="ads-post">' .htmlspecialchars_decode($get_meta["tie_banner_below"][0]) .'</div>';
  73. else tie_banner('banner_below' , '<div class="ads-post">' , '</div>' );
  74. }
  75. ?>
  76.  
  77. <?php if( ( tie_get_option( 'post_authorbio' ) && empty( $get_meta["tie_hide_author"][0] ) ) || ( isset( $get_meta["tie_hide_related"][0] ) && $get_meta["tie_hide_author"][0] == 'no' ) ): ?>
  78. <section id="author-box">
  79. <div class="block-head">
  80. <h3><?php _e( 'About', 'tie' ) ?> <?php the_author() ?> </h3><div class="stripe-line"></div>
  81. </div>
  82. <div class="post-listing">
  83. <?php tie_author_box() ?>
  84. </div>
  85. </section><!-- #author-box -->
  86. <?php endif; ?>
  87.  
  88.  
  89. <?php if( tie_get_option( 'post_nav' ) ): ?>
  90. <div class="post-navigation">
  91. <div class="post-previous"><?php previous_post_link( '%link', '<span>'. __( 'Previous:', 'tie' ).'</span> %title' ); ?></div>
  92. <div class="post-next"><?php next_post_link( '%link', '<span>'. __( 'Next:', 'tie' ).'</span> %title' ); ?></div>
  93. </div><!-- .post-navigation -->
  94. <?php endif; ?>
  95.  
  96. <?php get_template_part( 'includes/post-related' ); ?>
  97.  
  98. <?php endwhile;?>
  99.  
  100. <?php comments_template( '', true ); ?>
  101.  
  102. </div><!-- .content -->
  103. <?php get_sidebar(); ?>
  104. <?php get_footer(); ?>


Jeśli ktoś wie, gdzie mam dodać kod, żeby wszystko działało, to proszę o odpowiedż i pomoc.
djgarsi
Jak chcesz, żeby panele się pokazywały na wszystkich stronach witryny to dodaj te panele w pliku footer.php.
MrExeqtor
Wielkie dzięki. Pomogło.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.