| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/governmentgrants.us/wp-content/themes/governmentgrantsus/ |
Upload File : |
<?php
/**
* The template for displaying Category
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @since 1.0
* @version 1.0
*/
get_header();
?>
<section class="blogBgOuter" style="background:url(<?php echo get_template_directory_uri();?>/images/blogBg.png) left top no-repeat;">
<div class="container">
<div class="blogHd">
<h1><?php
$pageTitle = get_post_meta( $post->ID, 'custom_page_title', true);
if(!empty($pageTitle)){
echo $pageTitle;
}else{
the_title();
}
?></h1>
</div>
</div>
</section>
<?php
$post_per_page = get_option('posts_per_page');
$cat_name = single_cat_title( '', false );
$catid = get_cat_ID( $cat_name );
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type'=>'post',
'paged' => $paged,
'posts_per_page'=>$post_per_page,
'orderby'=>'date',
'order'=>'DESC',
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => $catid
)
));
$loop = new wp_query($args);
?>
<section class="blogBgOuterblog">
<div class="container">
<div class="postUL">
<?php
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="blogpost">
<strong><a href="<?php the_permalink();?>"><?php the_title(); ?></a></strong>
<em><?php the_category(); ?></em>
<p><?php
$content = get_the_excerpt();
if(!empty($content)){
echo mb_strimwidth($content, 0, 200, '...');
}else{
echo wp_trim_words(get_the_content(), 200);
}
?></p>
<a href="<?php the_permalink();?>">Read More >></a>
</div>
<?php
endwhile;
wp_reset_query();
?>
<div class="olderPost">
<span class="pre_btn">
<?php previous_posts_link('« Previous Page',$loop->max_num_pages); ?>
</span>
<span class="next_btn">
<?php next_posts_link('Next Page »',$loop->max_num_pages); ?>
</span>
</div>
<?php
}else{
echo '<p>Nothing has found.</p>';
}
wp_reset_postdata();
?>
</div>
</div>
</section>
<style type="text/css">
.blogpost{margin-bottom: 20px;}
.blogBgOuterblog{padding-top: 50px;padding-bottom:50px;}
</style>
<?php
get_footer();
?>