• 07-07-2019, 13:27:42
    #1
    Merhaba,

    Aşağıda belirttiğim sayfaya nasıl sidebar ekleyebilirim? Birkaç deneme yaptım ama sidebar sonrasında gelen içerik yine tam sayfa olarak çıktı. Yardımınız için teşekkürler.


    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<header class="entry-header">		
    		<?php
    		if ( is_single() ) :
    			the_title( '<h1 class="widget-title">', '</h1>' );
    		else :
    			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    		endif; ?>
    	</header><!-- .entry-header -->
    	<div class="photo-content">
    		
    		<?php if( strpos($post->post_content,'wp-block-gallery') || strpos($post->post_content,'class="gallery') ) : ?>
    			<div class="loading-photos"><?php esc_html_e('Loading photos', 'wpst'); ?>... (<span></span>)</div>
    		
    		<?php endif; ?>
    		
    		<?php the_content(); ?>
    	
    		<?php
    			$prev_post = get_previous_post();
    			if($prev_post) {
    				$prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
    				echo "\t" . '<a class="prev-photo" rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '"><i class="fa fa-chevron-left" aria-hidden="true"></i></a>' . "\n";
    			}
    			$next_post = get_next_post();
    				if($next_post) {
    				$next_title = strip_tags(str_replace('"', '', $next_post->post_title));
    				echo "\t" . '<a class="next-photo" rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '"><i class="fa fa-chevron-right" aria-hidden="true"></i></a>' . "\n";
    			}
    		?>
    	</div><!-- .entry-content -->
      <?php get_template_part( 'template-parts/content', 'related-photos' ); ?>
    	<?php // If comments are open or we have at least one comment, load up the comment template.
    	if( xbox_get_field_value( 'wpst-options', 'enable-comments' ) == 'on' ) {
    		if ( comments_open() || get_comments_number() ) :
    			comments_template();
    		endif;
    	} ?>
    </article><!-- #post-## -->
  • 07-07-2019, 13:36:19
    #2
    Visual composer vb. Colum mantigi. Hic kodla ugrasmayin
  • 07-07-2019, 14:00:28
    #3
    Hurtech adlı üyeden alıntı: mesajı görüntüle
    Visual composer vb. Colum mantigi. Hic kodla ugrasmayin
    Merhaba. Tema visual composer kullanmaya müsait değil maalesef. Sadece tekil post sayfasına sidebar eklemek istiyorum.
  • 08-07-2019, 00:03:35
    #4
    Merhaba,

    Sidebar göstermek istediğiniz yere <php get_sidebar(); ?> kodunu ekleyebilirsiniz. Temanızda bootstrap kullanmıyorsunuz sanırım. Öyle olsa kodu yazacaktım ama özel css ise kendinize göre css'ini yazmanız lazım.
  • 08-07-2019, 11:24:03
    #5
    temistan adlı üyeden alıntı: mesajı görüntüle
    Merhaba,

    Sidebar göstermek istediğiniz yere <php get_sidebar(); ?> kodunu ekleyebilirsiniz. Temanızda bootstrap kullanmıyorsunuz sanırım. Öyle olsa kodu yazacaktım ama özel css ise kendinize göre css'ini yazmanız lazım.
    Merhaba, cevap için teşekkürler. Yukarıda belirtmiş olduğum kodun tam olarak neresine koymamız gerekiyor? Daha önce birkaç yere ekledim sidebar kodu, ancak bozukluk meydana geldi. Farklı bir post şablonunda sidebar kısmı şu kodla belirtilmiş:

    <?php get_template_part( 'template-parts/content', 'sidebar-ads' ); ?>
  • 08-07-2019, 11:52:55
    #6
    Epimetheus adlı üyeden alıntı: mesajı görüntüle
    Merhaba, cevap için teşekkürler. Yukarıda belirtmiş olduğum kodun tam olarak neresine koymamız gerekiyor? Daha önce birkaç yere ekledim sidebar kodu, ancak bozukluk meydana geldi. Farklı bir post şablonunda sidebar kısmı şu kodla belirtilmiş:

    <?php get_template_part( 'template-parts/content', 'sidebar-ads' ); ?>
    Kodu sidebar'ı nerede çıkarmak istiyorsanız oraya eklemelisiniz. Sizin attığınız kod temaya özel ayrı bir sidebar yazılmış onu ekliyor. Onu da ekleyebilirsiniz.Yani biraz kod ve css/html bilginiz olmalı. Yoksa forumda ücretli iş yapan arkadaşlardan birine yaptırmanızı tavsiye ederim.