Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter emrichm10

    (@emrichm10)

    I figured out the answer, it was adding the words “category” and “list” in part of template-parts/latest/latest-post.php. I fixed by replacing these words with spaces

    <?php
    $category = '';
    if ( $category !='' ) {
    	$query = array(
    		'posts_per_page' => 3,
    		'order' => 'DESC',
    		'nopaging' => 0,
    		'post_status' => 'publish',
    		'ignore_sticky_posts' => 1,
    	);
    }else {
    	$query = array(
            'posts_per_page' => 3,
    		'order' => 'DESC',
    		'nopaging' => 0,
    		'post_status' => 'publish',
    		'ignore_sticky_posts' => 1,
    		'offset'=>1
    	);
     }
    $args = new WP_Query($query); ?>
    
    <?php
    
    	if ($args->have_posts()) {
    	?>
    	<div class="coblog-post-grid">
    		<div class="container">
                <div class="coblog-post-grid-wrap">
                    <?php
                    while ($args->have_posts()) : $args->the_post();
                    if ( has_post_thumbnail() ) {
                        $coblog_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ),'coblog-1140-600' );
                        $coblog_image ='style="background: url('.esc_url($coblog_src[0]).') no-repeat;background-size: cover;"'; 
                    }else {
                        $coblog_image ='style="background: #333;"';
                    }
                    $coblog_src2 = wp_get_attachment_image( get_post_thumbnail_id( get_the_ID() ),'coblog-1140-600' );
                    ?>
                    <div class="coblog-post-grid-item">
                        <div class="coblog-post-grid-overlay">
                            <div class="coblog-grid-overlay-img" <?php echo wp_kses_post($coblog_image);?>></div>
                            <a class="coblog-grid-link-overlay" href="<?php echo esc_url( get_permalink() ); ?>"><span class="screen-reader-text"><?php the_title(); ?></span></a>
                            <div class="coblog-grid-no-image">
                                    <?php echo esc_url($coblog_src2);?>
                            </div>
                            <div class="coblog-post-grid-content">
                                <div class="coblog-post-grid-content-overlay">
                                    <span class="coblog-post-grid-category"><?php echo <strong>wp_kses_post(get_the_category_list( esc_html__( 'category','coblog'  ), '', </strong>get_the_ID() ));?></span>
                                    <h4 class="coblog-post-grid-title">
                                        <a href="<?php echo esc_url( get_permalink() ); ?>"><?php the_title(); ?></a>
                                    </h4>
                                    <div class="coblog-post-grid-meta">
                                        <?php if ( get_the_author_meta('first_name') != "" || get_the_author_meta('last_name') != "" ) { ?>
                                            <?php echo esc_html__( 'By', 'coblog' );?><span class="post-grid-author"><a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) )); ?>"><?php echo esc_attr(get_the_author_meta('first_name'));?> <?php echo esc_attr(get_the_author_meta('last_name'));?></a></span>
                                        <?php } else { ?>
                                        <?php echo esc_html__( 'By', 'coblog' );?><span class="post-grid-author"><?php the_author_posts_link() ?></span>
                                        <?php }?>
                                        <span class="coblog-post-grid-date"><time datetime="<?php esc_attr( the_time( 'c' ) ); ?>"><?php echo get_the_date(); ?></time></span>
                                    </div>
                                </div> <!--/.coblog-post-grid-content-overlay-->
                            </div> <!--/.coblog-post-grid-content-->
                        </div> <!--/.coblog-post-grid-overlay-->
                    </div> <!--/.coblog-post-grid-item-->
                    <?php
                    endwhile;
                    wp_reset_postdata(); ?>
                </div> <!--/.coblog-post-grid-wrap-->
    		</div> <!--/.container-->
    	</div> <!--/.coblog-post-grid-->
    	<?php
    	}
    
    Thread Starter emrichm10

    (@emrichm10)

    .container {
        width: 100%;
        padding-right: 20px;
        padding-left: 20px;
        margin-right: auto;
        margin-left: auto;
    }
    .row {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        margin-right: -15px;
        margin-left: -15px;
    }
    .col-lg-4,.col-lg-3,.col-lg-6,.col-lg-12,.col-sm-12, .col-md-6,
    .col-md-12 {
        position: relative;
        width: 100%;
        padding-right: 15px;
        padding-left: 15px;
    }
    .text-center {
        text-align: center;
    }
    .clearfix::after {
        display: block;
        clear: both;
        content: "";
    }
      
    .d-none {
        display: none;
    }
    
    .d-block {
        display: block;
    }
    
    .media {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-align: start;
        align-items: flex-start;
    }
    .media-body {
        -ms-flex: 1;
        flex: 1;
    }
    .mt-0, .my-0 {
        margin-top: 0!important;
    }
    .mr-3, .mx-3 {
        margin-right: 1rem;
    }
    
    @media (min-width: 576px) {
        .container {
            max-width: 540px;
        }
        .d-sm-none {
            display: none;
        }
        .d-sm-block {
            display: block;
        }
        .col-sm-12 {
            -ms-flex: 0 0 100%;
            flex: 0 0 100%;
            max-width: 100%;
        }
    }
    @media (min-width: 768px) {
        .container {
            max-width: 720px;
        }
        .d-md-none {
            display: none;
        }
        .d-md-block {
            display: block;
        }
        .col-md-6 {
            -ms-flex: 0 0 50%;
            flex: 0 0 50%;
            max-width: 50%;
        }
        .col-md-12 {
            -ms-flex: 0 0 100%;
            flex: 0 0 100%;
            max-width: 100%;
        }
    }
    @media (min-width: 992px) {
        .container {
            max-width: 960px;
        }
        .d-lg-none {
            display: none;
        }
        .d-lg-block {
            display: block;
        }
        .col-lg-4 {
            -ms-flex: 0 0 33.333333%;
            flex: 0 0 33.333333%;
            max-width: 33.333333%;
        }
        .col-lg-3 {
            -ms-flex: 0 0 25%;
            flex: 0 0 25%;
            max-width: 25%;
        }
        .col-lg-6 {
            -ms-flex: 0 0 50%;
            flex: 0 0 50%;
            max-width: 50%;
        }
        .col-lg-12 {
            -ms-flex: 0 0 100%;
            flex: 0 0 100%;
            max-width: 100%;
        }
    }
    @media (min-width: 1200px) {
        .container {
            max-width: 1140px;
        }
        .d-xl-none {
            display: none;
        }
        .d-xl-block {
            display: block;
        }
    }
    • This reply was modified 5 years, 7 months ago by emrichm10.
Viewing 2 replies - 1 through 2 (of 2 total)