Blog Page Issue

5.23K viewsThemes

Im trying to make a blog page
currently the only way to do that now is to make a category and add all posts to it
like here

i guess a templete theme for blog page?



This code works perfect for me.

1. Just create an empty .php file. Paste the below code in it and save it in the templates folder (Also if you are using the askbug theme).

2. Create a new page in your WordPress and select the template you just created.

3. Now you can add this page to your menu if prefered.

I edited the code a bit so it would show the post details and make it clickable.


 * Template Name: Blog Page
 * Template used to display blog page
 * @package ab
get_header(); ?>
	<div class="container">
		<div class="row">
			<div id="content" class="main-content-inner col-sm-12<?php echo is_active_sidebar( 'sidebar-1' ) ? ' col-md-9' : ' col-md-12' ?>">
				<?php query_posts( 'show_posts=20&post_type=post&order=ASC&orderby=date' ); ?>
				<?php while ( have_posts() ) : the_post(); ?>

					<?php get_template_part('content'); ?>

				<?php endwhile; // end of the loop. ?>
			</div><!-- close .*-inner (main-content or sidebar, depending if sidebar is used) -->
			<?php get_sidebar(); ?>
		</div><!-- close .row -->
	</div><!-- close .container -->
<?php get_footer(); ?>

how do you limit the excerpt though? it shows the entire post

You can add a read-more tag in your original post. Thats how i do it.
If you want to code it, there is a function called custom_excerpt_length() if im not mistaken.


Here use this template for your blog page:

i think its something missing in the code

Updated code.

still shows nothing

u can delete this question