Support » Plugin: Simple Staff List » Customn Page Template – choose [simple-staff-list group=”Robots”] for sidebar

  • would you happen to know how to insert in the sidebar
    [simple-staff-list group=”Robots”]

    on the customn page with the following code

    <?php
    	if ( !defined('ABSPATH') ){ die(); }
    	
    	global $avia_config;
    
    	/*
    	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    	 */
    	 get_header();
    
     	 if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
     	 
     	 do_action( 'ava_after_main_title' );
    	 ?>
    
    		<div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'>
    
    			<div class='container'>
    
    				<main class='template-page content  <?php avia_layout_class( 'content' ); ?> units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>>
                        
                        <?php
    /**
    * Single Staff Member
    *
    */
     
     
    // First we get fields from our staff member custom post type into variables
     
    global $post;
    $custom     = get_post_custom();
    $t_name         = get_the_title();
    $name_slug  = basename(get_permalink());
    $title      = $custom["_staff_member_title"][0];
    $email      = $custom["_staff_member_email"][0];
    $phone      = $custom["_staff_member_phone"][0];
    $fax        = $custom["_staff_member_fax"][0];
    
                        
    $bio = $custom["_staff_member_bio"][0];
                      
                        
                        
                        
    $prof       = $custom["_staff_member_prof"][0];
    $fb_url     = $custom["_staff_member_fb"][0];
    
    if(has_post_thumbnail()){
     
    $t_photo_url = wp_get_attachment_url( get_post_thumbnail_id() );
    $t_photo = '<img class="staff-member-page-photo" src="'.$t_photo_url.'" alt = "'.$title.'">';
    }else{
    $t_photo_url = '';
    $t_photo = '';
    }
    $email_mailto = '<a class="staff-member-email" href="mailto:'.antispambot( $email ).'" title="Email '.$name.'">'.antispambot( $email ).'</a>';
    ?>   
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
     
     
    <?php /* The loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <div class="staff-member-wal">
    <h2><?php the_title(); ?></h2> <!-- This is the Standard page title -->
     
    <h3><?=$title?></h3> <!-- This is the Staff Memeber Title -->
     <br>
    <?=$t_photo?> <!-- This is the Staff Memeber Photo -->
     
        
    <?php    
    if ($bio){ echo '<div>' . wpautop( $bio ) . '</div>'; }      
    ?> 
    <?php    
    if ($email){ echo '<div><a href="mailto:$email">' . wpautop( $email ) . '</a></div>'; }      
    ?>     
        
    <?php the_content();?>
     
    <?php endwhile; ?>    
        </div>
    
                   
    
                       
    				<!--end content-->
    				</main>
    			<?php
    
    				//get the sidebar
    				$avia_config['currently_viewing'] = 'page';
    				get_sidebar();
    
    				?>
    
    			</div><!--end container-->
    
    		</div><!-- close default .container_wrap element -->
    
    <?php get_footer(); ?>
    

    thanks!

    https://wordpress.org/support/plugin/simple-staff-list/

Viewing 1 replies (of 1 total)
  • Plugin Author Brett Shumaker

    (@brettshumaker)

    @bcmans
    I realize this is an old post, and I hope you’ve solved your issue, but you should be able to insert the shortcode into a text widget in the sidebar (if your theme allows shortcodes in widgets to be processed). Though it may not look great if you have your Staff Loop setup to display on a regular page.

    You could, however, create your own widget and use the techniques talked about in this thread to get the staff data into your custom widget output.

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Customn Page Template – choose [simple-staff-list group=”Robots”] for sidebar’ is closed to new replies.