Example #1
0
                <div class="fullwidth"><?php 
    get_search_form();
    ?>
</div>
        <?php 
}
if ('person' == get_post_type()) {
    $out = '';
    $args = array('post_type' => 'person', 'order' => 'ASC', 'meta_key' => 'person_last_name', 'orderby' => 'meta_value', 'posts_per_page' => 30, 'offset' => 0);
    $person = new WP_Query($args);
    if ($person->have_posts()) {
        $out .= ' <table class="person">';
        while ($person->have_posts()) {
            $person->the_post();
            $post_id = $person->post->ID;
            $out .= piratenkleider_display_person($post_id, 'table');
        }
        $out .= '</table>';
        wp_reset_postdata();
    } else {
        $out = '<section class="shortcode person"><p>';
        $out .= __('No personal information found.', 'piratenkleider');
        $out .= "</p></section>\n";
    }
    wp_reset_query();
    echo $out;
} else {
    while (have_posts()) {
        the_post();
        /* gallery */
        if (in_category(_x('gallery', 'gallery category slug', 'piratenkleider'))) {
      <div class="skin">
       <?php 
        if (!(isset($image_url) && strlen($image_url) > 4)) {
            ?>
	    <h1 class="post-title"><span><?php 
            the_title();
            ?>
</span></h1>
	<?php 
        }
        ?>
 
        <section class="person">
    
		<?php 
        echo piratenkleider_display_person($post->ID, 'full', 0);
        ?>

		<div><?php 
        edit_post_link(__('Edit', 'piratenkleider'), '', '');
        ?>
</div>
        </section>
       
        
      </div>
	 <?php 
    }
}
// end of the loop.
?>
Example #3
0
 function get_piratenkleider_steckbrief()
 {
     global $post;
     global $options;
     $personid = esc_attr(get_post_meta($post->ID, 'piratenkleider-personalcard-id', true));
     if (isset($personid) && $personid > 0) {
         return piratenkleider_display_person($personid, 'sitebar');
     }
     $text = esc_attr(get_post_meta($post->ID, 'piratenkleider-sidebar-text', true));
     if (empty($text)) {
         /* Downwards compatibility */
         $text = esc_attr(get_post_meta($post->ID, 'text', true));
     }
     $image_url = get_post_meta($post->ID, 'piratenkleider-sidebar-image_url', true);
     $image_id = 0;
     if (empty($image_url)) {
         /* Downwards compatibility */
         $image_url = get_post_meta($post->ID, 'image_url', true);
     } else {
         $image_id = get_post_meta($post->ID, 'piratenkleider-sidebar-image_id', true);
     }
     $out = '';
     if (isset($text) && isset($image_url) && strlen(trim($text)) > 0 || isset($text) && strlen(trim($text)) > 0 && has_post_thumbnail()) {
         $out .= '<div id="steckbrief">';
         if (isset($image_url)) {
             if ($image_id > 0) {
                 $out .= wp_get_attachment_image($image_id, array($options['sidebar-steckbrief-maxwidth'], $options['sidebar-steckbrief-maxheight']));
             } else {
                 $out .= wp_get_attachment_image($image_url, array($options['sidebar-steckbrief-maxwidth'], $options['sidebar-steckbrief-maxheight']));
             }
         }
         $out .= "\n";
         $out .= ' <div class="text">';
         $out .= do_shortcode($text);
         $out .= "</div>\n";
         $out .= "</div>\n";
     }
     return $out;
 }