Removes title, meta and top margin when no title is passed to posts or pages. #20.

This commit is contained in:
mateuswetah 2019-10-07 10:54:56 -03:00
parent a9ef9227d0
commit cd9d388334
2 changed files with 41 additions and 33 deletions

View File

@ -1,18 +1,24 @@
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?> <?php while ( have_posts() ) : the_post(); ?>
<div class="tainacan-title"> <?php if ( the_title() != '') : ?>
<div class="border-bottom border-jelly-bean tainacan-title-page" style="border-width: 2px !important;"> <div class="tainacan-title">
<ul class="list-inline mb-1"> <div class="border-bottom border-jelly-bean tainacan-title-page" style="border-width: 2px !important;">
<li class="list-inline-item text-midnight-blue font-weight-bold title-page"> <ul class="list-inline mb-1">
<?php the_title(); ?> <li class="list-inline-item text-midnight-blue font-weight-bold title-page">
</li> <?php the_title(); ?>
<li class="list-inline-item float-right title-back"><a href="javascript:history.go(-1)"><?php _e( 'Back', 'tainacan-interface' ); ?></a></li> </li>
</ul> <li class="list-inline-item float-right title-back"><a href="javascript:history.go(-1)"><?php _e( 'Back', 'tainacan-interface' ); ?></a></li>
</ul>
</div>
</div> </div>
</div> <div class="mt-3 tainacan-single-post">
<div class="mt-3 tainacan-single-post"> <?php get_template_part( 'template-parts/single-post' ); ?>
<?php get_template_part( 'template-parts/single-post' ); ?> </div>
</div> <?php else: ?>
<div class="mt-0 tainacan-single-post">
<?php get_template_part( 'template-parts/single-post' ); ?>
</div>
<?php endif; ?>
<?php if ( ! is_singular( 'page' ) ) : ?> <?php if ( ! is_singular( 'page' ) ) : ?>
<div class="row justify-content-between"> <div class="row justify-content-between">
<span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'tainacan-interface' ) ); ?></span> <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'tainacan-interface' ) ); ?></span>

View File

@ -1,26 +1,28 @@
<article role="article" id="post_<?php the_ID()?>" <?php post_class()?>> <article role="article" id="post_<?php the_ID()?>" <?php post_class()?>>
<header class="mb-4"> <?php if ( the_title() != '') : ?>
<div class="header-meta text-muted mb-5 d-flex"> <header class="mb-4">
<?php if ( ! is_singular( 'page' ) ) { ?> <div class="header-meta text-muted mb-5 d-flex">
<?php tainacan_meta_date_author(); ?> <?php if ( ! is_singular( 'page' ) ) { ?>
<?php } ?> <?php tainacan_meta_date_author(); ?>
<div class="btn-group ml-auto" role="group"> <?php } ?>
<?php if ( true == get_theme_mod( 'tainacan_facebook_share', true ) ) : ?> <div class="btn-group ml-auto" role="group">
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>" class="" target="_blank"> <?php if ( true == get_theme_mod( 'tainacan_facebook_share', true ) ) : ?>
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/facebook-circle.png'; ?>" alt="<?php esc_attr_e('Share this on facebook', 'tainacan-interface') ?>"> <a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>" class="" target="_blank">
</a> <img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/facebook-circle.png'; ?>" alt="<?php esc_attr_e('Share this on facebook', 'tainacan-interface') ?>">
<?php endif; ?> </a>
<?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?> <?php endif; ?>
<?php $twitter_option = get_theme_mod( 'tainacan_twitter_user' ); ?> <?php if ( true == get_theme_mod( 'tainacan_twitter_share', true ) ) : ?>
<?php $via = ! empty( $twitter_option ) ? '&amp;via=' . esc_attr( get_theme_mod( 'tainacan_twitter_user' ) ) : ''; ?> <?php $twitter_option = get_theme_mod( 'tainacan_twitter_user' ); ?>
<a href="http://twitter.com/share?url=<?php the_permalink(); ?>&amp;text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class=""> <?php $via = ! empty( $twitter_option ) ? '&amp;via=' . esc_attr( get_theme_mod( 'tainacan_twitter_user' ) ) : ''; ?>
<img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/twitter-circle.png'; ?>" alt="<?php esc_attr_e('Share this on twitter', 'tainacan-interface') ?>"> <a href="http://twitter.com/share?url=<?php the_permalink(); ?>&amp;text=<?php the_title_attribute(); ?><?php echo $via; ?>" target="_blank" class="">
</a> <img src="<?php echo esc_url( get_template_directory_uri() ) . '/assets/images/twitter-circle.png'; ?>" alt="<?php esc_attr_e('Share this on twitter', 'tainacan-interface') ?>">
<?php endif; ?> </a>
<?php endif; ?>
</div>
</div> </div>
</div> <?php the_post_thumbnail(); ?>
<?php the_post_thumbnail(); ?> </header>
</header> <?php endif; ?>
<section class="tainacan-content text-black margin-two-column"> <section class="tainacan-content text-black margin-two-column">
<?php <?php
the_content(); the_content();