🏠 wiki
+ Přidat ✎ Upravit

Práce s menu a seznamem stránek

Přidat MENU

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

				<?php
					/**
					 * We are using a heading by rendering the_content
					 * If we have content for this page, let's display it.
					 */
					if ( '' != get_the_content() )
						get_template_part( 'content', 'intro' );
				?>

				<?php endwhile; ?>
                           
				<section class="recent-posts">
					<!--<h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1>-->
               <div class="nadpis"><?php echo the_title(); ?></div>

					<?php
                            
               $catSlug=$_SERVER["REQUEST_URI"];
               $catSlug=str_replace("/","",$catSlug);
					// Display our recent posts, showing full content for the very latest, ignoring Aside posts.
					$recent_args = array(
                  'category_name' => $catSlug,
						'order' => 'DESC',
					);

					// Our new query for the Recent Posts section.
					$recent = new WP_Query( $recent_args );
print_r($recent);					
               echo "<ul class='aktuality'>";
					while ( $recent->have_posts() ) : $recent->the_post(); ?>

						<li>
							<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
						</li>

					<?php
					endwhile;

					// If we had some posts, close the <ol>
					if ( $recent->post_count > 0 )
						echo '</ul>';
					?>
				</section><!-- .recent-posts -->

Nejnavštěvovanější

Práce s menu a seznamem stránek