• Here’s a link to the site: http://seattleseonetwork.org/about-us
    So what I need to do is to display the member’s posts when you click on their image. Keep in mind I already have an author’s page and the member’s page by default would be single-seo_member.php page.

    I’ve found a way to link that to the author’s page, but now some of the member’s have a 404 error or it defaults to Carl or Alex’s Author Page.

    Here’s the code:

    <?php
    //RETRIEVE MEMBERS FROM DATABASE
    query_posts( array(
                                'post_type' => 'seo_member',
                                'orderby' => 'rand'
                                 ));
    ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <article class="member clearfix">
    <div class="col-2 alignleft">
    <h3><a href="<?php /*the_permalink();*/ echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_title(); ?> - <?php the_field('ssn-title') ?></a></h3>
    <p class="caption"><a href="<?php the_field('member-company-link') ?>"><?php the_field('member-company') ?></a> - <?php the_field('working-title') ?></p>
    <?php the_field('member-bio') ?>
    <?php if(get_field('member-available-for-speaking') == true): ?>
    <br />
    <p><?php the_title(); ?> is available for <a href="<?php bloginfo('url') ?>/speakers">Speaking Events</a></p>
    <?php endif; ?>
    </div>
    <div class="col-1 alignright">
    <div class="member-thumb-container"><a href="<?php /*the_permalink();*/ echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><img src="<?php the_field('member-photo') ?>" alt="photo of SSN member" /></a></div>
    </div>
    </article><!-- END .MEMBER  -->
    <?php endwhile; else: ?>
    <p><?php _e('No Speakers Listed'); ?></p>
    <?php endif; ?>

    Please Help I’ve been wrestling with this for days!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Do you have multiple loops in this page template?
    Can you post the full template file here?

    Thread Starter starlajay

    (@starlajay)

    <?php
    /*
    Template Name: About-us Template
    */
    ?>
    <?php get_header(); ?>
    
    <section class="content-area alignleft clearfix">
    <article class="about-us">
    <?php //RUN DEFAULT WORDPRESS LOOP ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_content(); ?>
    
    <?php endwhile; ?>
    <?php endif; ?>
    
    <?php
    //RETRIEVE MEMBERS FROM DATABASE
    query_posts( array(
                                'post_type' => 'seo_member',
                                'orderby' => 'rand'
                                 ));
    ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <article class="member clearfix">
    <div class="col-2 alignleft">
    <h3><a href="<?php /*the_permalink();*/ echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php the_title(); ?> - <?php the_field('ssn-title') ?></a></h3>
    <p class="caption"><a href="<?php the_field('member-company-link') ?>"><?php the_field('member-company') ?></a> - <?php the_field('working-title') ?></p>
    <?php the_field('member-bio') ?>
    <?php if(get_field('member-available-for-speaking') == true): ?>
    <br />
    <p><?php the_title(); ?> is available for <a href="<?php bloginfo('url') ?>/speakers">Speaking Events</a></p>
    <?php endif; ?>
    </div>
    <div class="col-1 alignright">
    <div class="member-thumb-container"><a href="<?php /*the_permalink();*/ echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><img src="<?php the_field('member-photo') ?>" alt="photo of SSN member" /></a></div>
    </div>
    </article><!-- END .MEMBER  -->
    <?php endwhile; else: ?>
    <p><?php _e('No Speakers Listed'); ?></p>
    <?php endif; ?>
    
    <p>Interested in becoming a sponsor of an upcoming event? <a href="<?php echo bloginfo('url') ?>/contact">Contact us</a> for information on various sponsorship packages for upcoming events, or check out the <a href="<?php echo bloginfo('url') ?>/sponsors">sponsors</a> link above.</p>
    
    </section><!-- END .CONTENT-AREA -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Thread Starter starlajay

    (@starlajay)

    I also can post the author’s page as well if you need to see it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘display posts from members page’ is closed to new replies.