Last strokes:
Single post development.
single.php code:
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package lookalive
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) :
the_post();
?>
<div class="row border-between">
<div class="col-md-4">
<?php
if ( is_active_sidebar( 'left-sidebar-widget-area' ) ) :
dynamic_sidebar( 'left-sidebar-widget-area' );
endif;
?>
</div>
<div class="col-md-8">
<?php get_template_part( 'template-parts/content', "single" ); ?>
</div>
</div>
<?php
endwhile; // End of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
If there is any widget added in the left sidebar area, that sidebar is shown. In the right column, there is the template-parts/content-single.php code:
/**
* Template part for displaying page content in page.php
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package lookalive
*/
?>
<div class="row">
<div class="col-md-12">
<div class="card border-0 mx-auto">
<?php echo '<p></p><p class="card-category-text" style="line-height:1rem;margin-bottom:0.5rem;">';
the_category( '/' );
echo '</p>';?>
<?php the_title( '<h1 class="entry-title" style="margin-left:-0.25rem;line-height:2rem;">', '</h1>' ); ?>
<p class="card-category-author"><a href="/contact-page/"><?php echo get_the_author_meta('user_firstname', $post->post_author)." ".get_the_author_meta('user_lastname', $post->post_author); ?></a></p>
<div class="pic border-0">
<?php
the_post_thumbnail("large", array('class' => 'card-img-top img-fluid'));?>
</div>
<div class="card-block text-justify px-0 article-text">
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pag.:', 'lookalive' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="num_pag">',
'link_after' => '</span>',
) );
?>
</div>
</div>
</div>
</div>
Explanation: the content is grouped in a card, the post category is printed first, then the title, the featured image and the text.
Although there are some additional minor developments, they aren’t very relevant. The latest version of the code can be obtained in the github repository.
End of action – Version 0.0.2
Goals
- Establish the project’s main objectives.
- Define how to carry out the project (globally).
- Limitations.
- Strengths.
- Work methodology: operating framework, times, support platform, etc.
- First survey: preliminary research of WordPress themes.
- Web Design.
- Survey of magazine or news websites.
- Theme Research.
- Home template implementation. (HTML, CSS, Javascript)
- Prototyping tools selection.
- Logo Creation.
- Template implementation.
- Creation of a Bootstrap grid with the main sections: logo, menu, sticky menu without javascript implementation, different cover models, possible footers, possible widgets, main section (feed) and sidebar.
- Object modeling: posts for cover section.
- Object modeling: posts for main (feed) section.
- Adjustment of settings.
- Javascript interaction development (sticky menu and image shadowing).
- WordPress development.
- Get starter theme from underscores.
- Global elements development.
- Home Cover development.
- Home main feed development.
- Final details:
- Single posts.
- Template-parts, página 404 error.
- Bug fixing.