badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Change post title from appearing below to appearing above featured image

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #80237
    john
    Participant

    I want my post title to appear above my featured image. I don’t want it appearing below my featured image. (News card pro)

    #80319

    Hi john,

    Please go to “Theme Directory > template-parts > content.php”

    1- On line no: 52 you will find the below code.

    <?php if ( !has_post_format( 'quote' ) ) { // for not format quote ?>

    replace it with below code.

    <?php if ( !has_post_format( 'quote' ) && !is_single() ) { // for not format quote ?>

    2- Remove the below mentioned code from line no: 38 to 40.

    <div class="entry-meta category-meta">
    	<div class="cat-links"><?php echo esc_html( newscard_post_categories_display() ); ?></div>
    </div><!-- .entry-meta -->

    3- Add the below Custom Code on line no: 16.

    <?php if ( !has_post_format( 'quote' ) && is_single() ) { // for not format quote ?>
    	<div class="entry-meta category-meta">
    		<div class="cat-links"><?php echo esc_html( newscard_post_categories_display() ); ?></div>
    	</div><!-- .entry-meta -->
    	<header class="entry-header">
    		<?php if ( is_singular() ) {
    			the_title( '<h1 class="entry-title">', '</h1>' );
    		} else {
    			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
    		} ?>
    
    		<?php if ( 'post' === get_post_type() ) {
    			if ( !has_post_format( 'link' ) ){ // for not format link ?>
    			<div class="entry-meta">
    				<?php newscard_posted_on(); ?>
    				<?php if ( comments_open() && get_comments_number() ) { ?>
    					<div class="comments">
    						<?php comments_popup_link( __('No Comments', 'newscard'), __('1 Comment', 'newscard'), __('% Comments', 'newscard'), '', __('Comments Off', 'newscard') ); ?>
    					</div><!-- .comments -->
    				<?php } ?>
    			</div><!-- .entry-meta -->
    			<?php }
    		} ?>
    	</header>
    <?php } ?>

    NOTE: Please make the Child Theme before customizing the Theme Code so that you won’t loose the Customized Code when updating the Theme to a New Version in future.

    Thanks

    #80406
    john
    Participant

    Please the code line numbers you are giving does not correspond with mine for example Line 60

    <div class=”entry-meta category-meta”>
    <div class=”cat-links”><?php echo esc_html( newscard_post_categories_display() ); ?></div>
    </div><!– .entry-meta –>

    is at line 46 on my theme (News card pro)
    Kindly crosscheck your numbering please. Thank you

    #80410
    john
    Participant

    This query has been on for more thank 1 week now’
    Please Assist me soonest Thank you.

    #80412

    Sorry we traced the line no: after adding the codes. We have Updated the Line no. Please copy the previous codes of respective line no again.

    Thanks

    #80419
    john
    Participant

    I have done that but no changes its still the same.
    click to view

    #80420
    john
    Participant

    Okay i think, I got it right.
    There was already a header code on line 53 to 72. I erased it.
    Thanks for the assistance i really appreciate a lot.

    #80421
    john
    Participant

    But the header title in the post disappeared after clicking to view the post
    click

    #80422
    john
    Participant

    Although i have managed to fix that by adding
    <?php if ( is_singular() ) {
    the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ );
    } else {
    the_title( ‘<h2 class=”entry-title”>‘, ‘</h2>’ );
    } ?>

    on line line 62

    #80423
    john
    Participant

    Now i would like to add (Continue reading) button below the posts
    Just like this click to view

    how do i acheive this pls

    #80448

    Please go to “Theme Directory > template-parts > content-php”. On line no: 78 to 80 you will find below codes.
    (Since you have already customized content.php page then line no will be different)

    <div class="entry-content">
    	<p><?php echo wp_trim_words( get_the_excerpt(), absint($newscard_settings['newscard_excerpt_length_blog']) ); ?></p>
    </div><!-- entry-content -->

    Beneath the mentioned code just add the below mentioned Custom Code

    <a href="<?php echo esc_url( get_permalink() ) ?>" class="btn btn-outline-dark" style="margin-bottom: 10px;">Continue reading</a>

    Thanks

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.