At first I added the code like this
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<div class="entry-meta">
<?php education_hub_posted_on(); ?>
<?php echo do_shortcode(‘[jp_post_view]’); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<?php
do_action( 'education_hub_single_image' );
?>
<?php the_content(); ?>
After I added this code, the pages were loaded only till breadcrumb navigation. So, I tried like this
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
<div class="entry-meta">
<?php education_hub_posted_on(); ?>
echo do_shortcode('[jp_post_view]');
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<?php
do_action( 'education_hub_single_image' );
?>
<?php the_content(); ?>
This time, pages loaded well, but the output was displayed as just ‘echo do_shortcode(‘[jp_post_view]’);’
I thought to add the code in template-tags.php, where the function for <?php education_hub_posted_on(); ?> is defined.
The code there is like this
if ( ! function_exists( 'education_hub_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function education_hub_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
'%s',
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
$byline = sprintf(
'%s',
'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
);
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
}
endif;
But I have no idea how to add the code here.
Thank you!