File "single.php"
Full Path: /home/mba/public_html/wp-content-20250807152928/themes/twentytwenty-child-theme/single.php
File size: 4.15 KB
MIME-type: text/x-php
Charset: utf-8
<?php
get_header();
// Get all users order by amount of posts
$allUsers = get_users('orderby=post_count&order=DESC');
$users = array();
// Remove subscribers from the list as they won't write any articles
foreach($allUsers as $currentUser)
{
if(!in_array( 'subscriber', $currentUser->roles ))
{
$users[] = $currentUser;
}
}
?>
<section class="Business_News mt-3" id="content_main">
<div class="container">
<div class="col-md-12 mt-1 mb-3">
<a href="<?php echo site_url(); ?>" >Home</a> /
<?php
$categories = get_the_category();
?>
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": "1",
"item": {
"@id": "<?php echo site_url(); ?>",
"name": "Home"
}
},
{
"@type": "ListItem",
"position": "2",
"item": {
"@id": "<?php echo get_category_link( $categories[0]->term_id );?>",
"name": "<?php echo esc_html( $categories[0]->name ); ?>"
}
},
{
"@type": "ListItem",
"position": "3",
"item": {
"@id": "<?php echo get_the_permalink(get_the_ID()); ?>",
"name": "<?php echo get_the_title(get_the_ID()); ?>"
}
}
]
}
</script>
<a href="<?php echo get_category_link( $categories[0]->term_id ); ?>" ><?php echo esc_html( $categories[0]->name ); ?> </a> / <a href="<?php the_permalink(); ?>" ><?php the_title(); ?></a>
</div>
<div class="row">
<div class="col-md-8">
<div class="d-flex">
<div class="col-lg-12 border-line">
<div class="content_post">
<?php // theloop
if ( have_posts() ) : while ( have_posts() ) : the_post();
// single post
if ( is_single() ) :
$featured_img_url = get_the_post_thumbnail_url(get_the_ID(),'full');
?>
<h1 class="mb-0"><?php the_title(); ?></h1>
<?php
$image_id = get_post_thumbnail_id();
$image_alt = get_post_meta($image_id, '_wp_attachment_image_alt', TRUE);
$image_title = get_the_title($image_id);
?>
<span class="jl_post_meta mb-3">
<span class="jl_author_img_w"><i class="jli-user"></i>
<a href="#" title="Posts by Spraya" rel="author"><?php echo get_the_author(); ?></a>
</span>
<span class="post-date"><i class="jli-pen"></i><?php the_time( get_option( 'date_format' ) ); ?></span>
</span>
<a href="#"> <img class="img-fluid w-100 " src="<?php echo get_the_post_thumbnail_url(get_the_ID()," full");?>" alt="<?php echo $image_title;?>"></a>
<div class="ArticleCapImge"><?php echo the_post_thumbnail_caption(); ?></div>
<div class="content-overlay cont-2 single-custom-div-content py-4">
<a class="d-block mb-2 entry-category" href="#" rel="category tag"></a>
<div class="post_content jl_content">
<br><?php the_content(); ?>
</div>
<div class="milPostTags pt-3">
<ul>
<li class="mr-2 mainTags"><a href="JavaScript:void(0)" >TAGS :-</a></li>
<?php
$postTags = get_the_tags(get_the_ID());
if ( ! empty( $postTags ) ) {
foreach($postTags as $tag){
?>
<li><a href="<?php echo get_tag_link( $tag->term_id ); ?>"><?php echo $tag->name; ?></a></li>
<?php }}?>
</ul>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php //posts_nav_link(); ?>
<?php else: ?>
<?php get_404_template(); ?>
<?php endif; ?>
</div>
<div class="single-reply">
<?php comments_template(); ?>
</div>
</div>
</div>
</div>
<?php include("singlesidebar.php"); ?>
</div>
</div>
</section>
<?php get_footer(); ?>