Skip to content

WP Custom Theme Bootstrap Base

Subscribe if you want the Latest Ideas to your Email:





These are the boostrap resources links:

Get Bootsrap Base Theme: https://them.es/starter-bootstrap/
Get Bootstrap Color: https://bootswatch.com/

This is the code for content-index.php

<?php
/**
* The template for displaying content in the index.php template.
*/
?>

<article id=”post-<?php the_ID(); ?>” <?php post_class( ‘col-sm-6’ ); ?>>
<div class=”card mb-4″>
<header class=”card-body”>
<h2 class=”card-title”>
<a href=”<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘getdeals’ ), the_title_attribute( array( ‘echo’ => false ) ) ); ?>” rel=”bookmark”><?php the_title(); ?></a>
</h2>
<?php
if ( ‘post’ === get_post_type() ) :
?>
<div class=”card-text entry-meta”>
<?php
getdeals_article_posted_on();

$num_comments = get_comments_number();
if ( comments_open() && $num_comments >= 1 ) :
echo ‘ <a href=”‘ . esc_url( get_comments_link() ) . ‘” class=”badge badge-pill bg-secondary float-end” title=”‘ . esc_attr( sprintf( _n( ‘%s Comment’, ‘%s Comments’, $num_comments, ‘getdeals’ ), $num_comments ) ) . ‘”>’ . $num_comments . ‘</a>’;
endif;
?>
</div><!– /.entry-meta –>
<?php
endif;
?>
</header>
<div class=”card-body”>
<div class=”card-text entry-content”>
<?php
if ( has_post_thumbnail() ) {
$post_thumbnail_id = get_post_thumbnail_id();
$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );

echo “<div>”;
echo “<img class=’img-fluid’ src='{$post_thumbnail_url}’></div>”;

}

if ( is_search() ) {
the_excerpt();
} else {
the_excerpt();
}
?>
<?php wp_link_pages( array( ‘before’ => ‘<div class=”page-link”><span>’ . esc_html__( ‘Pages:’, ‘getdeals’ ) . ‘</span>’, ‘after’ => ‘</div>’ ) ); ?>
</div><!– /.card-text –>
<footer class=”entry-meta”>
<a href=”<?php the_permalink(); ?>” class=”btn btn-info”><?php esc_html_e( ‘more’, ‘getdeals’ ); ?></a>
</footer><!– /.entry-meta –>
</div><!– /.card-body –>
</div><!– /.col –>
</article><!– /#post-<?php the_ID(); ?> –>

Watch this video for Detailed Guide: