Fatih Tercan
asked 5 years ago

Hi Dominic. I have a question again. How can i create blog page template? Can you help me? Thaks for help

1 Answers
DominicStaff
answered 5 years ago

Hi,
If you want to crate a blog page template, you can crate a .php file in the folder theme then add the following code to the your file:

<?php
/**
 * Template Name: Blog Post
 */

get_header(); ?>

<div class="container ">
<?php query_posts( array ( 'category_name' => 'blog', 'posts_per_page' => -1 ) );; ?>
    <div class="row" >
        <div id="primary" class="">
            <?php if( have_posts() ): ?>
                <?php while( have_posts() ): the_post(); ?>
                <div id="post-<?php get_the_ID(); ?>" <?php post_class(); ?>>
                <?php if ( has_post_thumbnail() ) : ?>
                    <div class="pull-left margin-right-xs-1 entry-thumbnail" href="<?php the_permalink() ?>">
                        <?php the_post_thumbnail('thumbnail'); ?>
                    </div>
                <?php endif; ?>
                <div class="media-body">
                    <header class="entry-header">
                        <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
                    </header>
                    <div class="entry-meta">
                        <?php dw_focus_entry_meta(); ?>
                    </div>
                    <div class="entry-content">
                        <?php the_content('Read more...'); ?>
                    </div>
                </div>
                </div><!-- /#post-<?php get_the_ID(); ?> -->
                <?php endwhile; ?>

                <div class="navigation">
                    <?php dw_focus_post_navigation(); ?>    
                </div><!-- /.navigation -->
        </div>
    </div>
    <?php else: ?>
    <div id="post-404" class="noposts">
        <p><?php _e('None found.','example'); ?></p>
    </div><!-- /#post-404 -->
    <?php endif; wp_reset_query(); ?>
</div>
<?php get_footer(); ?>

Hope this helps !

wptrinfo
replied 5 years ago

thanks for answer. infact i want to make blog page like Focus 1.1.
like this : http://prntscr.com/8y38we
But i don’t have any idea. Can you help me.

dominic Staff
replied 5 years ago

At the moment, out theme does not support to make the blog page look like old version. Sorry about that, my friend.

wptrinfo
replied 5 years ago

Thanks

Powered by DW Question & Answer Pro