Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter fsucfasupport

    (@fsucfasupport)

    Interesting, okay – thanks!

    I am looking into it now, I am far from a pro with PHP and Queries.

    It looks like I need to add an action? Going to keep reading up on it.

    Any more information helps, thank you guys…

    Thread Starter fsucfasupport

    (@fsucfasupport)

    Here is what it looks like now…

    <?php
    /**
    Template Name: Development Test
    */
    get_header(); ?>

    <style type=”text/css”>
    .post-image img {
    height: 185px;
    width: 200px;
    object-fit: cover;
    }
    </style>

    <?php
    $page_id = get_the_ID();
    $key_1_value = get_post_meta($page_id,’section_1′,true);
    $key_2_value = get_post_meta($page_id,’section_2′,true);
    $key_3_value = get_post_meta($page_id,’section_3′,true);
    $key_4_value = get_post_meta($page_id,’section_4′,true);
    ?>

    <div class=”row”>
    <div class=”container”>
    <h1 class=”mobile-center” style=”font-size:40px; color:black; margin-top: 5px; font-weight:500;”>In the News</h1>

    <?php

    global $post;
    $args = array( ‘post_count’ => 12, ‘posts_per_page’ => 4, ‘category_name’ => ‘home-feed’, );

    $myposts = get_posts( $args );
    foreach ( $myposts as $post ) : setup_postdata( $post );
    ?>

    <div class=”row post-stream”>
    <div class=”col-md-3 col-sm-4 col-xs-12″>
    “><?php echo get_the_post_thumbnail( $post_id, ‘large’ ); ?>
    </div>
    <div class=”col-md-9 col-sm-8 col-xs-12″>
    <div style=”min-height: 135px;”>
    <h4 style=”margin-top: 0;”>
    “><?php the_title(); ?>
    </h4>
    <div class=”feed-date-tags”>
    <?php the_date(); ?>
    </div>
    <p>
    <?php echo excerpt(45); ?>
    </p>
    </div>
    “>Read More
    </div>
    </div>
    <hr>
    <?php endforeach; ?>

    <div class=”row”>
    <?php the_posts_pagination( array(
    ‘mid_size’ => 2,
    ‘prev_text’ => __( ‘Back’, ‘textdomain’ ),
    ‘next_text’ => __( ‘Onward’, ‘textdomain’ ),
    ) ); ?>
    </div>

    <?php wp_reset_postdata();?>

    </div>
    </div>

    <?php get_footer(); ?>

    Thread Starter fsucfasupport

    (@fsucfasupport)

    This looks very promising but I must be putting it in the wrong place in my code.

    Does it go after the foreach?

Viewing 3 replies - 1 through 3 (of 3 total)