Ejemplo n.º 1
0
 /**
  * @group 27238
  */
 public function test_get_the_taxonomies_term_template()
 {
     $post_id = $this->factory->post->create();
     $taxes = get_the_taxonomies($post_id, array('term_template' => '%2$s'));
     $this->assertEquals('Categories: Uncategorized.', $taxes['category']);
     $taxes = get_the_taxonomies($post_id, array('term_template' => '<span class="foo"><a href="%1$s">%2$s</a></span>'));
     $link = get_category_link(1);
     $this->assertEquals('Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $taxes['category']);
 }
function cftl_tax_landing_messages($messages)
{
    global $post;
    $taxonomy_array = get_the_taxonomies($post);
    if (!empty($taxonomy_array)) {
        $taxonomy_links = implode(' ', $taxonomy_array);
    } else {
        $taxonomy_links = __("No taxonomies specified.", 'cf-tax-landing');
    }
    $messages['cftl-tax-landing'] = array(0 => '', 1 => sprintf(__('Landing Page updated.  %s', 'cf-tax-landing'), $taxonomy_links), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __('Landing Page updated.', 'cf-tax-landing'), 5 => isset($_GET['revision']) ? sprintf(__('Landing Page restored to revision from %s', 'cf-tax-landing'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Landing Page published.  %s', 'cf-tax-landing'), $taxonomy_links), 7 => __('Landing Page saved.', 'cf-tax-landing'), 8 => sprintf(__('Landing Page submitted.  %s', 'cf-tax-landing'), $taxonomy_links), 9 => sprintf(__('Landing Page scheduled for: <strong>%1$s</strong>.', 'cf-tax-landing'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date))), 10 => sprintf(__('Landing Page updated.', 'cf-tax-landing')));
    return $messages;
}
Ejemplo n.º 3
0
 function test_get_the_taxonomies()
 {
     $post_id = $this->factory->post->create();
     $taxes = get_the_taxonomies($post_id);
     $this->assertNotEmpty($taxes);
     $this->assertEquals(array('category'), array_keys($taxes));
     $id = $this->factory->tag->create();
     wp_set_post_tags($post_id, array($id));
     $taxes = get_the_taxonomies($post_id);
     $this->assertNotEmpty($taxes);
     $this->assertCount(2, $taxes);
     $this->assertEquals(array('category', 'post_tag'), array_keys($taxes));
 }
Ejemplo n.º 4
0
 /**
  * Get a single already created AM_Tax.
  *
  * @since 1.2.0
  *
  * @param  null|string $tax_slug Slug of the AM_Tax to get. If null, the first current taxonomy is used.
  * @return null|AM_Tax           The requested AM_Tax, if it exists.
  */
 public static function get_single($tax_slug = null)
 {
     $tax_slug = isset($tax_slug) ? (array) $tax_slug : array_keys(get_the_taxonomies());
     // Get the first entry.
     $tax_slug = reset($tax_slug);
     return array_key_exists($tax_slug, self::$_all_taxs) ? self::$_all_taxs[$tax_slug] : null;
 }
Ejemplo n.º 5
0
function templatic_manage_seller_columns($column, $post_id)
{
    echo '<link href="' . get_template_directory_uri() . '/monetize/admin.css" rel="stylesheet" type="text/css" />';
    global $post;
    switch ($column) {
        /* If displaying the 'status' column. */
        case 'status':
            /* Get the post meta. */
            $status = fetch_status(get_post_meta($post_id, 'status', true), get_post_meta($post_id, 'is_expired', true));
            /* If no status is found, output a default message. */
            _e($status, 'templatic');
            break;
            /* If displaying the 'coupon_start_date_time' column. */
        /* If displaying the 'coupon_start_date_time' column. */
        case 'coupon_start_date_time':
            /* Get the coupon_start_date_time for the post. */
            $coupon_start_date_time = get_post_meta($post_id, 'coupon_start_date_time', true);
            /* If coupon_start_date_time were found. */
            if ($coupon_start_date_time != '') {
                echo date('Y-m-d H:i:s', $coupon_start_date_time);
            } else {
                _e('Unknown');
            }
            break;
        case 'coupon_end_date_time':
            /* Get the coupon_end_date_time for the post. */
            $coupon_end_date_time = get_post_meta($post_id, 'coupon_end_date_time', true);
            /* If coupon_end_date_time were found. */
            if (!empty($coupon_end_date_time)) {
                echo date('Y-m-d H:i:s', $coupon_end_date_time);
            } else {
                _e('Continue deal');
            }
            break;
        case 'deal_sold':
            /* Get the deal_sold for the post. */
            $deal_sold = deal_transaction($post_id);
            /* If deal_sold were found. */
            if (!empty($deal_sold)) {
                echo $deal_sold;
            } else {
                _e('0');
            }
            break;
        case 'post_category':
            /* Get the post_category for the post. */
            if (templ_is_show_post_category()) {
                $category = get_the_taxonomies($post);
                $category_display = str_replace(CUSTOM_MENU_CAT_TITLE . ':', '', $category['seller_category']);
                $category_display = str_replace(' and ', ', ', $category_display);
                echo $category_display = str_replace(',,', ', ', $category_display);
            } else {
                _e('Uncategorized');
            }
            break;
        case 'post_tags':
            /* Get the post_tags for the post. */
            $tags = get_the_taxonomies($post);
            $tags_display = str_replace(CUSTOM_MENU_TAG_TITLE . ':', '', $tags['seller_tags']);
            $tags_display = str_replace(' and ', ', ', $tags_display);
            echo $tags_display = str_replace(',,', ', ', $tags_display);
            break;
        case 'total_item':
            /* Get the total_item for the post. */
            $total_item = get_post_meta($post_id, 'no_of_coupon', true);
            /* If terms were found. */
            if (!empty($total_item)) {
                echo $total_item;
            } else {
                _e('0');
            }
            break;
            /* Just break out of the switch statement for everything else. */
        /* Just break out of the switch statement for everything else. */
        default:
            break;
    }
}
    function widget($args, $instance)
    {
        extract($args);
        $i = 1;
        $title = apply_filters('widget_title', $instance['title']);
        $colprops = explode('-', $instance["multiple"]);
        $count = $instance["perpage"];
        $colcount = $colprops[0];
        $gallery = false;
        $noimage = false;
        $rel = '';
        switch ($colcount) {
            case '1':
                $grid = $grid_width;
                $cols = 1;
                $colw = $grid_width;
                break;
            case '2':
                $grid = ($grid_width - $instance["mmargin"]) / 2;
                $cols = 2;
                $colw = $grid;
                break;
            case '3':
                $grid = ($grid_width - $instance["mmargin"] * 2) / 3;
                $cols = 3;
                $colw = $grid;
                break;
            case '4':
                $grid = ($grid_width - $instance["mmargin"] * 3) / 4;
                $cols = 4;
                $colw = $grid;
                break;
        }
        $colcount = $cols;
        if ($colcount == 1 && ($colprops[2] == 'ri' || $colprops[2] == 'li' || $colprops[2] == 'gl' || $colprops[2] == 'gr')) {
            $imgw = $instance[multiplew];
        } else {
            $imgw = $colw;
        }
        switch ($colprops[2]) {
            case 'ri':
                $align = 'float:right;margin-top:4px;margin-left:15px;';
                break;
            case 'li':
                $align = 'float:left;margin-top:4px;margin-right:15px;';
                break;
            case 'gl':
                $align = 'float:left;margin-top:4px;margin-right:15px;';
                $rel = 'rel="prettyPhoto[]"';
                $gallery = true;
                break;
            case 'gr':
                $align = 'float:right;margin-left:15px;margin-top:4px;';
                $rel = 'rel="prettyPhoto[]"';
                $gallery = true;
                break;
            case 'g':
                $rel = 'rel="prettyPhoto[]"';
                $gallery = true;
                break;
            case 'i':
                break;
            default:
                $noimage = true;
                break;
        }
        //Print the Style
        ?>
        		
<style type="text/css">
#<?php 
        echo $widget_id;
        ?>
 {
	float:left;
	width:<?php 
        echo $grid;
        ?>
px;
	margin-right:<?php 
        echo $instance["mmargin"];
        ?>
px;
}
#<?php 
        echo $widget_id;
        ?>
 .aligner {
	<?php 
        echo $align;
        ?>
}
</style>
<?php 
        if ($responsivetheme) {
            ?>
<style type="text/css">
	@media screen and (min-width:720px) and (max-width: 979px) {
		#<?php 
            echo $widget_id;
            ?>
{
	    	float:left;
	        width:100%;	
	        margin-right:0;
		}
#<?php 
            echo $widget_id;
            ?>
 .aligner {
			<?php 
            if (isset($align)) {
                echo $align;
            } else {
                echo 'width:100%;';
            }
            ?>
		}
		#<?php 
            echo $widget_id;
            ?>
 .aligner img {
			max-width:100%;
			}
	}
	@media screen and (min-width:320px) and (max-width: 719px) {
		#<?php 
            echo $widget_id;
            ?>
{
	    	float:left;
	        width:100%;	
		}
		#<?php 
            echo $widget_id;
            ?>
 .aligner {
			width:100%;
		}
		#<?php 
            echo $widget_id;
            ?>
 .aligner img {
			max-width:100%;
		}
	}
</style>
<?php 
        }
        ?>
				
        		<?php 
        global $wp_filter;
        $source = $instance['source'];
        $the_content_filter_backup = $wp_filter['the_content'];
        $looporder1 = isset($instance['looporder1']) ? $instance['looporder1'] : '';
        $looporder2 = isset($instance['looporder2']) ? $instance['looporder2'] : '';
        $skip = isset($instance['skip']) ? $instance['skip'] : 0;
        // set order defaults
        $orderby = 'date';
        $order = 'DESC';
        $order = isset($instance['orderdir']) ? $instance['orderdir'] : 'DESC';
        if ($looporder1) {
            $orderby = $looporder1;
            $setby1 = true;
        }
        if ($looporder2) {
            if ($setby1) {
                $orderby .= ' ' . $looporder2;
            } else {
                $orderby = $looporder2;
            }
        }
        if (eregi('ptype-', $source)) {
            $post_type = str_replace('ptype-', '', $source);
        } elseif (eregi('cat-', $source)) {
            $post_type = 'post';
            $cat = str_replace('cat-', '', $source);
        } elseif (eregi('taxonomy-', $source)) {
            $prop = explode('|', str_replace('taxonomy-', '', $source));
            $post_type = $prop[0];
            $taxonmy['taxonomy'] = $prop[1];
            $taxonmy['term'] = $prop[2];
        }
        $query = array('posts_per_page' => (int) $count, 'post_type' => $post_type, 'orderby' => $orderby, 'order' => $order);
        if ($skip > 0) {
            $query['offset'] = $skip;
        }
        if ($cat) {
            $query['cat'] = $cat;
        }
        if (isset($taxonmy)) {
            $query['taxonomy'] = $taxonmy['taxonomy'];
            $query['term'] = $taxonmy['term'];
        }
        $query['showposts'] = $count;
        $r = new WP_Query($query);
        if ($r->have_posts()) {
            while ($r->have_posts()) {
                $r->the_post();
                global $post;
                if ($colcount != 1) {
                    //gridd
                    if ($i == 1) {
                        $i++;
                        $gps = false;
                    } elseif ($i == $colcount) {
                        $gps = true;
                        $i = 1;
                    } else {
                        $i++;
                        $gps = false;
                    }
                } else {
                    $grid = '';
                    $gps = '';
                }
                //gridd
                ?>
					     	<div class="post post-<?php 
                echo $post->ID;
                ?>
 ultimatepost-custom <?php 
                if ($gps) {
                    echo "last";
                }
                ?>
" id="<?php 
                echo $widget_id;
                ?>
">
					        	<div class="post-inner">
					        		<?php 
                $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                if (!$img && $instance["mnoimage"] == 'true') {
                    if (get_theme_option('general', 'noimage')) {
                        $img[0] = get_theme_option('general', 'noimage');
                    } else {
                        $img[0] = THEME_URI . '/images/no-image.jpg';
                    }
                    $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["multipleh"], true);
                } else {
                    $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["multipleh"], true);
                }
                if (!$noimage) {
                    $video = get_post_meta($post->ID, 'ultimatum_video', true);
                    $sc = '[video width="100%" height="' . $instance["multipleh"] . '"]' . $video . '[/video]';
                    if ($imgw != $colw || $instance["mimgpos"] == 'btitle') {
                        ?>
		        							<div class="aligner">
		        								<div class="featured-image">
		       										<?php 
                        if ($gallery) {
                            if ($video) {
                                $link = $video . '';
                            } else {
                                $link = $img[0];
                            }
                        }
                        if ($img) {
                            if ($video && $instance["mvideo"] == 'replace') {
                                echo do_shortcode($sc);
                            } else {
                                ?>
		        											<a href="<?php 
                                if ($gallery) {
                                    echo $link;
                                } else {
                                    the_permalink();
                                }
                                ?>
" <?php 
                                echo $rel;
                                ?>
 class="preload <?php 
                                if ($gallery) {
                                    if ($video) {
                                        echo 'image_play';
                                    } else {
                                        echo 'image_zoom';
                                    }
                                }
                                ?>
" style="position:relative;float:left;padding:0;margin:0;line-height:0px;" >
		        												<img src="<?php 
                                echo $imgsrc;
                                ?>
" style="padding:0;margin:0;line-height:0px;" alt="<?php 
                                the_title();
                                ?>
" />
		        											</a>
		        										<?php 
                            }
                            if ($video && $instance["mvideo"] == 'aimage') {
                                echo do_shortcode($sc);
                            }
                        }
                        ?>
		        								</div>
		        								<?php 
                        if ($instance["mmeta"] == 'aimage') {
                            echo $this->blog_multimeta($instance);
                        }
                        ?>
		        							</div>
		        					<?php 
                    }
                }
                if (!$grid) {
                    $wi = $grid_width - ($imgw + 15);
                    echo '<div>';
                } else {
                    echo '<div>';
                }
                ?>
		        		 	<?php 
                if ($instance["mtitle"] == 'true') {
                    ?>
			        		  <h2 class="post-header">
			        		  <?php 
                    if ($rel) {
                        ?>
			        		  <?php 
                        the_title();
                        ?>
			        		  <?php 
                    } else {
                        ?>
			        		  <a class="post-title" href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        the_title();
                        ?>
</a>
			        		  <?php 
                    }
                    ?>
			        		  </h2>
			        		  <?php 
                }
                ?>
			        		 <?php 
                if ($imgw == $colw && $instance["mimgpos"] == 'atitle') {
                    ?>
		        				<div class="aligner">
		        				<div class="featured-image">
		       					<?php 
                    if ($gallery) {
                        if ($video) {
                            $link = $video . '';
                        } else {
                            $link = $img[0];
                        }
                    }
                    if ($img) {
                        ?>
		        					<?php 
                        if ($video && $instance["mvideo"] == 'replace') {
                            ?>
		        						<?php 
                            echo do_shortcode($sc);
                            ?>
		        					<?php 
                        } else {
                            ?>
		        					<a href="<?php 
                            if ($gallery) {
                                echo $link;
                            } else {
                                the_permalink();
                            }
                            ?>
" <?php 
                            echo $rel;
                            ?>
 class="preload"><img src="<?php 
                            echo $imgsrc;
                            ?>
"  alt="<?php 
                            the_title();
                            ?>
" /></a>
		        					<?php 
                        }
                        ?>
		        					<?php 
                        if ($video && $instance["mvideo"] == 'aimage') {
                            ?>
		        						<?php 
                            echo do_shortcode($sc);
                            ?>
		        					<?php 
                        }
                        ?>
		        					<?php 
                    }
                    ?>
		        					</div>
		        					<?php 
                    if ($instance["mmeta"] == 'aimage') {
                        echo $this->blog_multimeta($instance);
                    }
                    ?>
		        				</div>
		        		   <?php 
                }
                ?>
			        		  <?php 
                if ($video && $instance["mvideo"] == 'atitle') {
                    ?>
		        						<?php 
                    echo do_shortcode($sc);
                    ?>
		        				 <?php 
                }
                ?>
			        		  <?php 
                if ($instance["mmeta"] == 'atitle') {
                    echo $this->blog_multimeta($instance);
                }
                ?>
			        		  <?php 
                if ($instance["excerpt"] == 'true') {
                    ?>
				        		 <p class="post-excerpt"><?php 
                    echo wp_html_excerpt(get_the_excerpt(), $instance["excerptlength"]);
                    ?>
...</p>
			        		  <?php 
                } elseif ($instance['excerpt'] == 'content') {
                    ?>
			        		  	<p class="post-excerpt"><?php 
                    the_content();
                    ?>
</p>
			        		  <?php 
                }
                ?>
			        		  <?php 
                if ($instance["mmeta"] == 'atext') {
                    echo $this->blog_multimeta($instance);
                }
                $tax = '';
                if ($instance["mcats"] == 'acontent') {
                    $tax = array();
                    $_tax = array();
                    $_tax = get_the_taxonomies();
                    if (empty($_tax)) {
                    } else {
                        foreach ($_tax as $key => $value) {
                            preg_match('/(.+?): /i', $value, $matches);
                            $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>';
                        }
                    }
                    echo '<div class="post-meta taxonomy">' . join('<br />', $tax) . '</div>';
                }
                if ($instance["mreadmore"] != 'false') {
                    ?>
			        		  		<p style="text-align:<?php 
                    echo $instance["mreadmore"];
                    ?>
">
			        		  		<a href="<?php 
                    the_permalink();
                    ?>
" class="readmorecontent" >
			        		  			<?php 
                    _e($instance["rmtext"], THEME_LANG_DOMAIN);
                    ?>
			        		  		</a>
			        		  		</p>
			        		  <?php 
                }
                ?>
			        		  </div>
			        		  </div>
			        		</div>
		        		 
		        		  
		        		  <?php 
                if ($i == 1) {
                    echo '<div style="clear:both"></div>';
                }
            }
        }
        ?>
        <?php 
        echo '<div style="clear:both"></div>';
        ?>

        <?php 
        wp_reset_postdata();
        $wp_filter['the_content'] = $the_content_filter_backup;
    }
 public function shortcode_podcast_show($attr)
 {
     $err = -1;
     $show = "";
     $all_shows = get_terms('podcast_show', 'hide_empty=0');
     $speaker_tax = 'podcast_speaker';
     $series_tax = 'podcast_series';
     // Error #2: No showname in shortcode given!
     if (empty($attr)) {
         $err = 2;
     }
     // if attributes are given check if these are
     // podcast_show slugs and list only these shows
     if (!empty($attr) and isset($attr['show'])) {
         $possible_shows = $this->get_all_shows($all_shows);
         // Asume: Error #3: No show exists with that name!
         $err = 3;
         foreach ($attr as $key => $value) {
             if (in_array($value, $possible_shows)) {
                 $show = $value;
                 $err = -1;
             }
         }
     }
     $args = array('post_type' => self::POST_TYPE, 'order' => 'DESC', 'oderby' => 'date', 'tax_query' => array('relation' => 'AND', array('taxonomy' => 'podcast_show', 'field' => 'slug', 'terms' => $show)));
     $category_posts = new WP_Query($args);
     $episodes = array();
     while ($category_posts->have_posts()) {
         $category_posts->the_post();
         $i = array_push($episodes, $category_posts->post);
         $postID = $episodes[$i - 1]->ID;
         // $post_tax = array();
         // $post_tax['podcast_show'] = wp_get_post_terms( $postID, 'podcast_show' );
         // $post_tax['podcast_speaker'] = wp_get_post_terms( $postID, $speaker_tax );
         // $post_tax['podcast_series'] = wp_get_post_terms( $postID, $series_tax );
         // $episodes[$i-1]->taxonomies = $post_tax;
         $episodes[$i - 1]->taxonomies = get_the_taxonomies($postID);
         $episodes[$i - 1]->metadata = get_metadata('post', $postID);
     }
     include dirname(dirname(__FILE__)) . 'shortcodes/templates/shortcode_podcast_show-template.php';
 }
Ejemplo n.º 8
0
function the_taxonomies($args = array()) {
	$defaults = array(
		'post' => 0,
		'before' => '',
		'sep' => ' ',
		'after' => '',
	);

	$r = wp_parse_args( $args, $defaults );
	extract( $r, EXTR_SKIP );

	echo $before . join($sep, get_the_taxonomies($post)) . $after;
}
Ejemplo n.º 9
0
function yoast_breadcrumb($prefix = '', $suffix = '', $display = true)
{
    global $wp_query, $post, $curauth;
    $opt = get_option("yoast_breadcrumbs");
    function bold_or_not($input)
    {
        $opt = get_option("yoast_breadcrumbs");
        if ($opt['boldlast']) {
            return '' . $input . '';
        } else {
            return $input;
        }
    }
    // Copied and adapted from WP source
    function yoast_get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE)
    {
        $chain = '';
        $parent =& get_category($id);
        if (is_wp_error($parent)) {
            return $parent;
        }
        if ($nicename) {
            $name = $parent->slug;
        } else {
            $name = $parent->cat_name;
        }
        if ($parent->parent && $parent->parent != $parent->term_id) {
            $chain .= get_category_parents($parent->parent, true, $separator, $nicename);
        }
        $chain .= bold_or_not($name);
        return $chain;
    }
    function yoast_get_term_parents($id, $term_type = 'category', $link = FALSE, $separator = '/', $nicename = FALSE)
    {
        $chain = '';
        $category = get_term($id, $term_type, $output, $filter);
        if (is_wp_error($category)) {
            return $category;
        }
        _make_cat_compat($category);
        $parent = $category;
        if (is_wp_error($parent)) {
            return $parent;
        }
        if ($nicename) {
            $name = $parent->slug;
        } else {
            $name = $parent->cat_name;
        }
        $term_child = get_term_children($id, $term_type);
        if ($parent->parent && $parent->parent != $parent->term_id) {
            $chain .= '<a href="' . get_term_link($parent->parent, $term_type) . '">' . yoast_get_term_parents($parent->parent, $term_type, true, $separator, $nicename) . '</a>' . $separator;
        }
        $chain .= bold_or_not($name);
        return $chain;
    }
    $nofollow = ' ';
    if ($opt['nofollowhome']) {
        $nofollow = ' rel="nofollow" ';
    }
    $on_front = get_option('show_on_front');
    if ($on_front == "page") {
        $homelink = '<a' . $nofollow . 'href="' . get_permalink(get_option('page_on_front')) . '">' . $opt['home'] . '</a>';
        $bloglink = $homelink . ' ' . $opt['sep'] . ' <a href="' . get_permalink(get_option('page_for_posts')) . '">' . $opt['blog'] . '</a>';
    } else {
        $homelink = '<a' . $nofollow . 'href="' . get_bloginfo('url') . '">' . $opt['home'] . '</a>';
        $bloglink = $homelink;
    }
    if ($on_front == "page" && is_front_page() || $on_front == "posts" && is_home()) {
        $output = bold_or_not($opt['home']);
    } elseif ($on_front == "page" && is_home()) {
        $output = $homelink . ' ' . $opt['sep'] . ' ' . bold_or_not($opt['blog']);
    } elseif (!is_page()) {
        $output = $bloglink . ' ' . $opt['sep'] . ' ';
        if ((is_single() || is_category() || is_tag() || is_date() || is_author()) && $opt['singleparent'] != 0) {
            $output .= '<a href="' . get_permalink($opt['singleparent']) . '">' . get_the_title($opt['singleparent']) . '</a> ' . $opt['sep'] . ' ';
        }
        if (is_single() && $opt['singlecatprefix']) {
            if ($post->post_type == CUSTOM_POST_TYPE1) {
                global $post;
                $cats = wp_get_post_terms($post->ID, CUSTOM_CATEGORY_TYPE1);
                $cat = $cats[0];
                //$output .= yoast_get_term_parents($cat->term_id,CUSTOM_CATEGORY_TYPE1, true, " ".$opt['sep']." ");
                $output .= join(" " . $opt['sep'] . " ", get_the_taxonomies($post)) . " " . $opt['sep'] . " ";
            } else {
                $cats = get_the_category();
                $cat = $cats[0];
                if ($cat) {
                    $output .= get_category_parents($cat->term_id, true, " " . $opt['sep'] . " ");
                }
            }
        }
        if (is_archive()) {
            if (is_tag()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . single_cat_title('', false));
            } elseif (is_date()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . single_month_title(' ', false));
            } elseif (is_author()) {
                $user = get_userdatabylogin($wp_query->query_vars['author_name']);
                $output .= bold_or_not($opt['archiveprefix'] . " " . $curauth->nickname);
            } elseif (is_category()) {
                $cat = intval(get_query_var('cat'));
                $output .= yoast_get_category_parents($cat, false, " " . $opt['sep'] . " ");
            } elseif (is_year()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . get_the_time('Y'));
            } elseif (is_month()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . get_the_time('F, Y'));
            } elseif (is_date()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . get_the_time('F jS, Y'));
            } else {
                global $wp_query, $post;
                $cat = $wp_query->get_queried_object();
                $output .= yoast_get_term_parents($cat, $term_type = CUSTOM_CATEGORY_TYPE1, false, " " . $opt['sep'] . " ");
            }
        } elseif (is_search()) {
            $output .= bold_or_not(get_search_query());
        } else {
            $output .= bold_or_not(get_the_title());
        }
    } else {
        $post = $wp_query->get_queried_object();
        // If this is a top level Page, it's simple to output the breadcrumb
        if (0 == $post->post_parent) {
            $output = $homelink . " " . $opt['sep'] . " " . bold_or_not(get_the_title());
        } else {
            if (isset($post->ancestors)) {
                if (is_array($post->ancestors)) {
                    $ancestors = array_values($post->ancestors);
                } else {
                    $ancestors = array($post->ancestors);
                }
            } else {
                $ancestors = array($post->post_parent);
            }
            // Reverse the order so it's oldest to newest
            $ancestors = array_reverse($ancestors);
            // Add the current Page to the ancestors list (as we need it's title too)
            $ancestors[] = $post->ID;
            $links = array();
            foreach ($ancestors as $ancestor) {
                $tmp = array();
                $tmp['title'] = strip_tags(get_the_title($ancestor));
                $tmp['url'] = get_permalink($ancestor);
                $tmp['cur'] = false;
                if ($ancestor == $post->ID) {
                    $tmp['cur'] = true;
                }
                $links[] = $tmp;
            }
            $output = $homelink;
            foreach ($links as $link) {
                $output .= ' ' . $opt['sep'] . ' ';
                if (!$link['cur']) {
                    $output .= '<a href="' . $link['url'] . '">' . $link['title'] . '</a>';
                } else {
                    $output .= bold_or_not($link['title']);
                }
            }
        }
    }
    if ($opt['prefix'] != "") {
        $output = $opt['prefix'] . " " . $output;
    }
    if ($display) {
        echo $prefix . $output . $suffix;
    } else {
        return $prefix . $output . $suffix;
    }
}
Ejemplo n.º 10
0
        ?>
					<div class="slide-3">
						<?php 
        if (get_field('link_externo') == "") {
            $link = get_field('link2');
        } else {
            $link = get_field('link_externo');
        }
        ?>
						<div class="texto-slider">
						<a href="<?php 
        echo $link;
        ?>
">
						<?php 
        $titulo = get_the_taxonomies($post->ID);
        the_content();
        ?>
						</a>			
						</div>
						<a href="<?php 
        echo $link;
        ?>
">
						<?php 
        the_post_thumbnail('slider-1');
        ?>
		
						</a>			
					</div>
					<?php 
Ejemplo n.º 11
0
            the_content();
            ?>
	</div><!-- [ /.entry-body ] -->

	<div class="entry-footer">
	<?php 
            $args = array('before' => '<nav class="page-link"><dl><dt>Pages :</dt><dd>', 'after' => '</dd></dl></nav>', 'link_before' => '<span class="page-numbers">', 'link_after' => '</span>', 'echo' => 1);
            wp_link_pages($args);
            ?>

	<?php 
            /*-------------------------------------------*/
            /*  Category and tax data
            	/*-------------------------------------------*/
            $args = array('template' => __('<dl><dt>%s</dt><dd>%l</dd></dl>', 'lightning'), 'term_template' => '<a href="%1$s">%2$s</a>');
            $taxonomies = get_the_taxonomies($post->ID, $args);
            $taxnomiesHtml = '';
            if ($taxonomies) {
                foreach ($taxonomies as $key => $value) {
                    if ($key != 'post_tag') {
                        $taxnomiesHtml .= '<div class="entry-meta-dataList">' . $value . '</div>';
                    }
                }
                // foreach
            }
            // if ($taxonomies)
            $taxnomiesHtml = apply_filters('lightning_taxnomiesHtml', $taxnomiesHtml);
            echo $taxnomiesHtml;
            ?>

	<?php 
Ejemplo n.º 12
0
function ultimatum_post_tax() {
	global $post;
	$_tax = get_the_taxonomies();
	if (!empty($_tax) ){
		foreach ( $_tax as $key => $value ) {
			preg_match( '/(.+?): /i', $value, $matches );
			$tax[] = '<span class="entry-tax-'. $key .'">' . str_replace( $matches[0], '<span class="entry-tax-meta">'. $matches[1] .':</span> ', $value ) . '</span>';
		}
	}
	if(count($tax)!=0){
	echo '<div class="post-taxonomy">'.join( '<br />', $tax ).'</div>';
	}
}
        the_title('<h1 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h1>');
    }
    ?>

						<div class="entry-meta">
							<?php 
    if (!post_password_required() && (comments_open() || get_comments_number())) {
        ?>
							<span class="comments-link"><?php 
        comments_popup_link(__('Leave a comment', 'dicentis'), __('1 Comment', 'dicentis'), __('% Comments', 'dicentis'));
        ?>
</span>
							<?php 
    }
    edit_post_link(__('Edit', 'dicentis'), '<span class="edit-link">', '</span>');
    $taxonomy_names = get_the_taxonomies();
    foreach ($taxonomy_names as $key => $value) {
        echo $value;
        echo " | ";
    }
    ?>
						</div><!-- .entry-meta -->
					</header><!-- .entry-header -->

					<?php 
    if (is_search()) {
        ?>

					<?php 
    } else {
        ?>

	<!--Portfolio holder -->
	<div class="relatedHolder ofsTop ofsBottom">

		<!--Title-->
		<div class="title dark ">
			<h1>
				<?php 
        echo esc_html__('Related Works', 'pranon');
        ?>
<span class="plus">+</span>
			</h1>
		</div>
		<?php 
        $taxonomy = get_the_taxonomies(get_the_ID());
        if (isset($taxonomy)) {
            foreach ($taxonomy as $key => $name) {
                $taxonomy_name = $key;
            }
            $get_terms = get_the_terms(get_the_ID(), $taxonomy_name);
            $term = array();
            $display_term = '';
            foreach ($get_terms as $key => $get_term) {
                array_push($term, $get_term->slug);
                if ($key == count($get_terms) - 1) {
                    $display_term .= esc_html($get_term->name);
                } else {
                    $display_term .= esc_html($get_term->name) . ', ';
                }
            }
Ejemplo n.º 15
0
function cftl_tax_landing_extras_box($post)
{
    wp_nonce_field(plugin_basename(__FILE__), 'cftl_tax_landing_extras_nonce');
    $taxonomy_array = get_the_taxonomies($post);
    if (!empty($taxonomy_array)) {
        $taxonomy_links = implode('<br/>', $taxonomy_array);
    } else {
        $taxonomy_links = __("No taxonomies specified.", 'cf-tax-landing');
    }
    $page_template = get_post_meta($post->ID, '_wp_page_template', true);
    ?>
<div class="form-field">
	<label for="cftl_page_template"><?php 
    _e('Page Template', 'cf-tax-landing');
    ?>
</label>
	<select name="cftl_page_template" id="cftl_page_template">
		<option value=""<?php 
    echo empty($page_template) ? ' selected="selected"' : '';
    ?>
><?php 
    _e('No Template (Use Post Templates)', 'cf-tax-landing');
    ?>
</option>
		<option value="default"<?php 
    echo "default" == $page_template ? ' selected="selected"' : '';
    ?>
><?php 
    _e('Default (Page) Template', 'cf-tax-landing');
    ?>
</option>
		<?php 
    page_template_dropdown($page_template);
    ?>
	</select>
</div>
<div class="form-field">
	<label><?php 
    _e('Current taxonomy links:', 'cf-tax-landing');
    ?>
</label><br/>
	<?php 
    echo $taxonomy_links;
    ?>
</div>
<?php 
}
 function excerpt_in_category($opt_category, $width)
 {
     /**
      * excerpt in category
      */
     $return['data'] = $this->content;
     $return['excerpt'] = false;
     $taxonomies = get_the_taxonomies(get_the_ID());
     foreach ($taxonomies as $key => $value) {
         $taxonomy = $key;
         $category = wp_get_post_terms(get_the_ID(), $taxonomy);
         foreach ($category as $n) {
             $current_category = $n->term_id;
             $excerpt_in_category = $opt_category;
             if (is_array($excerpt_in_category) && in_array($current_category, $excerpt_in_category)) {
                 $return['data'] = tonjoo_ecae_excerpt($this->content, $width, $this->justify);
                 $return['excerpt'] = true;
                 break 2;
             }
         }
     }
     return $return;
 }
Ejemplo n.º 17
0
 function rt_get_post_navigation()
 {
     global $post;
     if (is_singular("portfolio")) {
         if (!get_option(RT_THEMESLUG . '_hide_portfolio_navigation')) {
             return false;
         }
     }
     if (is_singular("products")) {
         if (!get_option(RT_THEMESLUG . '_hide_product_navigation')) {
             return false;
         }
     }
     if (!is_singular("portfolio") && !is_singular("products") || post_password_required()) {
         return false;
     }
     //next and previous links
     $rt_taxonomy = key(get_the_taxonomies($post->ID));
     $terms = get_the_terms($post->ID, $rt_taxonomy);
     $prev = is_array($terms) ? rt_mod_get_adjacent_post(true, true, '', $rt_taxonomy, 'date') : get_adjacent_post("", "", true);
     $next = is_array($terms) ? rt_mod_get_adjacent_post(true, false, '', $rt_taxonomy, 'date') : get_adjacent_post("", "", false);
     $prev_post_link_url = $prev ? get_permalink($prev->ID) : "";
     $next_post_link_url = $next ? get_permalink($next->ID) : "";
     $next_post_link = $next_post_link_url ? rt_shortcode_button(array("id" => '', "button_size" => 'small', "href_title" => __('Next Post', 'rt_theme') . ": " . $next->post_title, "button_link" => $next_post_link_url, "button_icon" => 'icon-right-open', "button_style" => 'white', "link_open" => '_self', "margin_top" => 0)) : false;
     $prev_post_link = $prev_post_link_url ? rt_shortcode_button(array("id" => '', "button_size" => 'small', "href_title" => __('Previous Post', 'rt_theme') . " :" . $prev->post_title, "button_link" => $prev_post_link_url, "button_icon" => 'icon-left-open', "button_style" => 'white', "link_open" => '_self', "margin_top" => 0)) : false;
     $add_class = $prev_post_link == false || $next_post_link == false ? "single" : "";
     // if previous link is empty add class to fix white border
     $post_navigation = $next_post_link || $prev_post_link ? '<div class="post-navigations margin-b20 ' . $add_class . '">' . $prev_post_link . '' . $next_post_link . '</div>' : "";
     echo $post_navigation;
 }
Ejemplo n.º 18
0
/**
 * Display the taxonomies of a post with available options.
 *
 * This function can be used within the loop to display the taxonomies for a
 * post without specifying the Post ID. You can also use it outside the Loop to
 * display the taxonomies for a specific post.
 *
 * The available defaults are:
 * 'post' : default is 0. The post ID to get taxonomies of.
 * 'before' : default is empty string. Display before taxonomies list.
 * 'sep' : default is empty string. Separate every taxonomy with value in this.
 * 'after' : default is empty string. Display this after the taxonomies list.
 * 'template' : The template to use for displaying the taxonomy terms.
 *
 * @since 2.5.0
 * @uses get_the_taxonomies()
 *
 * @param array $args Override the defaults.
 */
function the_taxonomies( $args = array() ) {
	$defaults = array(
		'post' => 0,
		'before' => '',
		'sep' => ' ',
		'after' => '',
		/* translators: %s: taxonomy label, %l: list of term links */
		'template' => __( '%s: %l.' )
	);

	$r = wp_parse_args( $args, $defaults );

	echo $r['before'] . join( $r['sep'], get_the_taxonomies( $r['post'], $r ) ) . $r['after'];
}
Ejemplo n.º 19
0
the_modified_date('');
?>
</span></span>

<?php 
// Post author
$meta_hidden_author = isset($lightning_theme_options['postAuthor_hidden']) && $lightning_theme_options['postAuthor_hidden'] ? ' entry-meta_hidden' : '';
?>

<span class="vcard author entry-meta_items entry-meta_items_author<?php 
echo $meta_hidden_author;
?>
"><span class="fn"><?php 
the_author();
?>
</span></span>

<?php 
$page_for_posts = lightning_get_page_for_posts();
$taxonomies = get_the_taxonomies();
if ($taxonomies) {
    // get $taxonomy name
    $taxonomy = key($taxonomies);
    $terms = get_the_terms(get_the_ID(), $taxonomy);
    $term_url = esc_url(get_term_link($terms[0]->term_id, $taxonomy));
    $term_name = esc_html($terms[0]->name);
    echo '<span class="entry-meta_items entry-meta_items_term"><a href="' . $term_url . '" class="btn btn-xs btn-primary">' . $term_name . '</a></span>';
}
?>

</div>
Ejemplo n.º 20
0
    function widget($args, $instance)
    {
        extract($args);
        $per_page = $instance["perpage"];
        if (ULTIMATUM_LOOP != 'wp') {
            include "loops/" . ULTIMATUM_LOOP . ".php";
        } else {
            if (is_single() || is_page()) {
                if (preg_match('/.php/i', $instance["single"])) {
                    $loopfile = $instance["single"];
                }
            } else {
                global $wp_query;
                $paged = get_query_var('paged') && get_query_var('paged') > 1 ? get_query_var('paged') : 1;
                $args = array_merge($wp_query->query, array('posts_per_page' => $per_page, "paged" => $paged));
                query_posts($args);
                if (preg_match('/.php/i', $instance["multiple"])) {
                    $loopfile = $instance["multiple"];
                }
            }
            if ($loopfile) {
                include THEME_LOOPS_DIR . '/' . $loopfile;
            } else {
                $title = apply_filters('widget_title', $instance['title']);
                $colprops = explode('-', $instance["multiple"]);
                $colcount = $colprops[0];
                $gallery = false;
                $noimage = false;
                $rel = '';
                switch ($colcount) {
                    case '1':
                        $grid = $grid_width;
                        $cols = 1;
                        $colw = $grid_width;
                        break;
                    case '2':
                        $grid = ($grid_width - $instance["mmargin"]) / 2;
                        $cols = 2;
                        $colw = $grid;
                        break;
                    case '3':
                        $grid = ($grid_width - $instance["mmargin"] * 2) / 3;
                        $cols = 3;
                        $colw = $grid;
                        break;
                    case '4':
                        $grid = ($grid_width - $instance["mmargin"] * 3) / 4;
                        $cols = 4;
                        $colw = $grid;
                        break;
                }
                ?>
        <div id="content">

        <?php 
                $i = 1;
                if (is_single() || is_page()) {
                    if (have_posts()) {
                        while (have_posts()) {
                            the_post();
                            global $post;
                            switch ($instance["single"]) {
                                case 'rimage':
                                    $image = true;
                                    $align = "float:right;margin-left:20px;";
                                    $imgw = $instance["singlew"];
                                    break;
                                case 'limage':
                                    $image = true;
                                    $align = "float:left;margin-right:20px;";
                                    $imgw = $instance["singlew"];
                                    break;
                                case 'fimage':
                                    $image = true;
                                    $imgw = $grid_width;
                                    $imgw = $instance["singlew"];
                                    $align = '';
                                    break;
                                default:
                                    $image = false;
                                    $align = '';
                                    break;
                            }
                            $styler = '
                  <style type="text/css">
                  #' . $widget_id . '{
                  float:left;
                  width:100%;

                  }
                  #' . $widget_id . ' .aligner{
                  ' . $align . '
                  }
                  ';
                            if ($responsivetheme) {
                                $styler .= '
                  @media screen and (min-width:720px) and (max-width: 979px) {
                  #' . $widget_id . '{
                  float:left;
                  width:100%;
                  margin-right:0;
                  }
                  #' . $widget_id . ' .aligner {';
                                if (isset($align)) {
                                    $styler .= $align;
                                } else {
                                    $styler .= 'width:100%;';
                                }
                                $styler .= '
                  }
                  #' . $widget_id . ' .aligner img{
                  max-width:100%;
                  }
                  }
                  @media screen and (min-width:240px) and (max-width: 719px) {
                  #' . $widget_id . '{
                  float:left;
                  width:100%;
                  }
                  #' . $widget_id . ' .aligner {
                  width:100%;
                  }
                  #' . $widget_id . ' .aligner img{
                  max-width:100%;
                  }
                  }';
                            }
                            $styler .= '</style>';
                            echo $styler;
                            ?>



                  <div class="post-<?php 
                            echo $post->ID;
                            ?>
 ultimatepost" id="<?php 
                            echo $widget_id;
                            ?>
">
                   <div class="post-inner-single">
                     <?php 
                            if ($image) {
                                $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                                if (!isset($img) && $instance["noimage"] == 'true') {
                                    if (get_theme_option('general', 'noimage')) {
                                        $img[0] = get_theme_option('general', 'noimage');
                                    } else {
                                        $img[0] = THEME_URI . '/images/no-image.jpg';
                                    }
                                    $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["singleh"], true);
                                } else {
                                    $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["singleh"], true);
                                }
                            }
                            if ($image && $img) {
                                ?>
                     <div class="aligner" >
                     <?php 
                                if ($instance["gallery"] == 'nivo') {
                                    $this->post_gallery('nivo', $imgw, $instance["singleh"], $instance["thumbs"], $instance);
                                } else {
                                    ?>
                        <?php 
                                    if ($instance["meta"] == 'bimage') {
                                        echo $this->blog_meta($instance);
                                    }
                                    ?>
                        <?php 
                                    if ($img) {
                                        ?>
                        <a href="<?php 
                                        if ($gallery) {
                                            echo $link;
                                        } else {
                                            the_permalink();
                                        }
                                        ?>
" <?php 
                                        echo $rel;
                                        ?>
>
                        <img src="<?php 
                                        echo $imgsrc;
                                        ?>
" alt="<?php 
                                        the_title();
                                        ?>
" /></a>
                        <?php 
                                    }
                                    ?>
                        <?php 
                                    if ($instance["gallery"] == 'aimage') {
                                        $this->post_gallery('thumbs', $imgw, $instance["singleh"], $instance["thumbs"], $instance);
                                    }
                                    ?>
                     <?php 
                                }
                                ?>
                        <?php 
                                if ($instance["meta"] == 'aimage') {
                                    echo $this->blog_meta($instance);
                                }
                                ?>
                     </div>

                        <?php 
                            }
                            ?>
                        <div>
                       <?php 
                            if ($instance["title"] == 'true') {
                                ?>
                    <h2 class="post-header"><a class="post-title" href="<?php 
                                the_permalink();
                                ?>
" ><?php 
                                the_title();
                                ?>
</a></h2>
                    <?php 
                            }
                            ?>
                    <?php 
                            if ($instance["meta"] == 'atitle') {
                                echo $this->blog_meta($instance);
                            }
                            ?>
                    <div class="the-post-content">
                    <?php 
                            $retainformat = false;
                            if ($retainformat) {
                                $content = get_the_content_with_formatting();
                                $content = apply_filters('the_content', $content);
                                echo $content;
                            } else {
                                the_content();
                            }
                            ?>
                    <?php 
                            wp_link_pages();
                            ?>
                    </div>

                    <?php 
                            if ($instance["meta"] == 'atext') {
                                echo $this->blog_meta($instance);
                            }
                            if ($instance["cats"] == 'acontent' && !is_page()) {
                                $_tax = get_the_taxonomies();
                                if (empty($_tax)) {
                                } else {
                                    foreach ($_tax as $key => $value) {
                                        preg_match('/(.+?): /i', $value, $matches);
                                        $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>';
                                    }
                                }
                                echo '<div class="post-taxonomy">' . join('<br />', $tax) . '</div>';
                            }
                            ?>
                    </div>

                    </div>
                    <?php 
                            //echo get_post_meta($post->ID, 'ultimatum_author', true);
                            if (get_post_meta($post->ID, 'ultimatum_author', true) == 'true') {
                                if (get_the_author_meta('description') && is_multi_author()) {
                                    // If a user has filled out their description and this is a multi-author blog, show a bio on their entries
                                    ?>
                     <div id="author-info">
                        <div id="author-avatar">
                           <?php 
                                    echo get_avatar(get_the_author_meta('user_email'), 68);
                                    ?>
                        </div><!-- #author-avatar -->
                        <div id="author-description">
                           <h2><?php 
                                    printf(esc_attr__('About %s', THEME_LANG_DOMAIN), get_the_author());
                                    ?>
</h2>
                           <?php 
                                    the_author_meta('description');
                                    ?>
                           <div id="author-link">
                              <a href="<?php 
                                    echo esc_url(get_author_posts_url(get_the_author_meta('ID')));
                                    ?>
" rel="author">
                                 <?php 
                                    printf(__('View all posts by %s <span class="meta-nav">&rarr;</span>', THEME_LANG_DOMAIN), get_the_author());
                                    ?>
                              </a>
                           </div><!-- #author-link -->
                        </div><!-- #author-description -->
                     </div><!-- #entry-author-info -->
                     <?php 
                                }
                            }
                            ?>


                  </div>
                  <div class="clearboth"></div>
                  <?php 
                            if ($instance['show_comments_form'] == 'true') {
                                comments_template('', true);
                            }
                        }
                    }
                    // end of single or page Main IF for Loop
                } else {
                    //multi post
                    $colcount = $cols;
                    if ($colcount == 1 && ($colprops[2] == 'ri' || $colprops[2] == 'li' || $colprops[2] == 'gl' || $colprops[2] == 'gr')) {
                        $imgw = $instance[multiplew];
                    } else {
                        $imgw = $colw;
                    }
                    switch ($colprops[2]) {
                        case 'ri':
                            $align = 'float:right;margin-top:4px;margin-left:15px;';
                            break;
                        case 'li':
                            $align = 'float:left;margin-top:4px;margin-right:15px;';
                            break;
                        case 'gl':
                            $align = 'float:left;margin-top:4px;margin-right:15px;';
                            $rel = 'rel="prettyPhoto[]"';
                            $gallery = true;
                            break;
                        case 'gr':
                            $align = 'float:right;margin-left:15px;margin-top:4px;';
                            $rel = 'rel="prettyPhoto[]"';
                            $gallery = true;
                            break;
                        case 'g':
                            $rel = 'rel="prettyPhoto[]"';
                            $gallery = true;
                            $align = '';
                            break;
                        case 'i':
                            $align = '';
                            break;
                        default:
                            $noimage = true;
                            $align = '';
                            break;
                    }
                    //Print the Style
                    $styler = '
<style type="text/css">
.ultimatepost{
   float:left;
   width:' . $grid . 'px;';
                    if (isset($instance['mmargin'])) {
                        $styler .= 'margin-right:' . $instance["mmargin"] . 'px;';
                    }
                    $styler .= '}
.ultimatepost .aligner{
   ' . $align . '
}
';
                    if ($responsivetheme) {
                        $styler .= '
   @media screen and (min-width:720px) and (max-width: 979px) {
      .ultimatepost{
         float:left;
           width:100%;
           margin-right:0;
      }
.ultimatepost .aligner {';
                        if (isset($align)) {
                            $styler .= $align;
                        } else {
                            $styler .= 'width:100%;';
                        }
                        $styler .= '
      }
      .ultimatepost .aligner img{
         max-width:100%;
         }
   }
   @media screen and (min-width:240px) and (max-width: 719px) {
      .ultimatepost{
         float:left;
           width:100%;
      }
      .ultimatepost .aligner {
         width:100%;
      }
      .ultimatepost .aligner img{
         max-width:100%;
      }
   }';
                    }
                    $styler .= '</style>';
                    echo $styler;
                    if (!have_posts()) {
                        $shownopostsmsg = isset($instance['shownopostsmsg']) ? $instance['shownopostsmsg'] : '';
                        $nopostsmsg = isset($instance['nopostsmsg']) ? $instance['nopostsmsg'] : '';
                        if ($shownopostsmsg) {
                            ?>
               <div id=" <?php 
                            echo $widget_id . '-noposts';
                            ?>
 class="tricky-dflt-noposts" >
                    <?php 
                            echo $nopostsmsg;
                            ?>
               </div>
               <?php 
                        }
                    }
                    if (have_posts()) {
                        if ($instance["mtitle"] == 'true') {
                            ?>

                   <h1 class="multi-post-title"><?php 
                            echo strip_tags(wp_title('', false, 'left'));
                            ?>
</h1>
                   <?php 
                        }
                        global $wp_query;
                        $paged = get_query_var('paged') && get_query_var('paged') > 1 ? get_query_var('paged') : 1;
                        $args = array_merge($wp_query->query, array('posts_per_page' => $per_page, "paged" => $paged));
                        query_posts($args);
                        while (have_posts()) {
                            the_post();
                            global $post;
                            if ($colcount != 1) {
                                //gridd
                                if ($i == 1) {
                                    $i++;
                                    $gps = false;
                                } elseif ($i == $colcount) {
                                    $gps = true;
                                    $i = 1;
                                } else {
                                    $i++;
                                    $gps = false;
                                }
                            } else {
                                $grid = '';
                                $gps = '';
                            }
                            //gridd
                            ?>
                     <div class="post post-<?php 
                            echo $post->ID;
                            ?>
 ultimatepost <?php 
                            if ($gps) {
                                echo "last";
                            }
                            ?>
">
                        <div class="post-inner">
                           <?php 
                            $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                            if (!$img && $instance["mnoimage"] == 'true') {
                                if (get_theme_option('general', 'noimage')) {
                                    $img[0] = get_theme_option('general', 'noimage');
                                } else {
                                    $img[0] = THEME_URI . '/images/no-image.jpg';
                                }
                                $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["multipleh"], true);
                            } else {
                                $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["multipleh"], true);
                            }
                            if (!$noimage) {
                                $video = get_post_meta($post->ID, 'ultimatum_video', true);
                                $sc = '[video width="100%" height="' . $instance["multipleh"] . '"]' . $video . '[/video]';
                                if ($imgw != $colw || $instance["mimgpos"] == 'btitle') {
                                    ?>
                                 <div class="aligner">
                                    <div class="featured-image">
                                          <?php 
                                    if ($gallery) {
                                        if ($video) {
                                            $link = $video . '';
                                        } else {
                                            $link = $img[0];
                                        }
                                    }
                                    if ($img) {
                                        if ($video && $instance["mvideo"] == 'replace') {
                                            echo do_shortcode($sc);
                                        } else {
                                            ?>
                                             <a href="<?php 
                                            if ($gallery) {
                                                echo $link;
                                            } else {
                                                the_permalink();
                                            }
                                            ?>
" <?php 
                                            echo $rel;
                                            ?>
 class="preload <?php 
                                            if ($gallery) {
                                                if ($video) {
                                                    echo 'image_play';
                                                } else {
                                                    echo 'image_zoom';
                                                }
                                            }
                                            ?>
" style="position:relative;float:left;padding:0;margin:0;line-height:0px;" >
                                                <img src="<?php 
                                            echo $imgsrc;
                                            ?>
" style="padding:0;margin:0;line-height:0px;" alt="<?php 
                                            the_title();
                                            ?>
" />
                                             </a>
                                          <?php 
                                        }
                                        if ($video && $instance["mvideo"] == 'aimage') {
                                            echo do_shortcode($sc);
                                        }
                                    }
                                    ?>
                                    </div>
                                    <?php 
                                    if ($instance["mmeta"] == 'aimage') {
                                        echo $this->blog_multimeta($instance);
                                    }
                                    ?>
                                 </div>
                           <?php 
                                }
                            }
                            if (!$grid) {
                                $wi = $grid_width - ($imgw + 15);
                                echo '<div>';
                            } else {
                                echo '<div>';
                            }
                            ?>
                       <h2 class="post-header">
                       <?php 
                            if ($rel) {
                                ?>
                       <?php 
                                the_title();
                                ?>
                       <?php 
                            } else {
                                ?>
                       <a class="post-title" href="<?php 
                                the_permalink();
                                ?>
"><?php 
                                the_title();
                                ?>
</a>
                       <?php 
                            }
                            ?>
                       </h2>
                      <?php 
                            if ($imgw == $colw && $instance["mimgpos"] == 'atitle') {
                                ?>
                        <div class="aligner">
                        <div class="featured-image">
                           <?php 
                                if ($gallery) {
                                    if ($video) {
                                        $link = $video . '';
                                    } else {
                                        $link = $img[0];
                                    }
                                }
                                if ($img) {
                                    ?>
                           <?php 
                                    if ($video && $instance["mvideo"] == 'replace') {
                                        ?>
                              <?php 
                                        echo do_shortcode($sc);
                                        ?>
                           <?php 
                                    } else {
                                        ?>
                           <a href="<?php 
                                        if ($gallery) {
                                            echo $link;
                                        } else {
                                            the_permalink();
                                        }
                                        ?>
" <?php 
                                        echo $rel;
                                        ?>
 class="preload"><img src="<?php 
                                        echo $imgsrc;
                                        ?>
"  alt="<?php 
                                        the_title();
                                        ?>
" /></a>
                           <?php 
                                    }
                                    ?>
                           <?php 
                                    if ($video && $instance["mvideo"] == 'aimage') {
                                        ?>
                              <?php 
                                        echo do_shortcode($sc);
                                        ?>
                           <?php 
                                    }
                                    ?>
                           <?php 
                                }
                                ?>
                           </div>
                           <?php 
                                if ($instance["mmeta"] == 'aimage') {
                                    echo $this->blog_multimeta($instance);
                                }
                                ?>
                        </div>
                     <?php 
                            }
                            ?>
                       <?php 
                            if ($video && $instance["mvideo"] == 'atitle') {
                                ?>
                              <?php 
                                echo do_shortcode($sc);
                                ?>
                         <?php 
                            }
                            ?>
                       <?php 
                            if ($instance["mmeta"] == 'atitle') {
                                echo $this->blog_multimeta($instance);
                            }
                            ?>
                       <?php 
                            if ($instance["excerpt"] == 'true') {
                                ?>
                         <p class="post-excerpt">
                           <?php 
                                echo wp_html_excerpt(get_the_excerpt(), $instance["excerptlength"]);
                                ?>
...
                           <?php 
                                if ($instance["mreadmore"] == 'after') {
                                    ?>
                              <a href="<?php 
                                    the_permalink();
                                    ?>
" class="readmorecontent" >
                                 <span><?php 
                                    _e($instance["rmtext"], THEME_LANG_DOMAIN);
                                    ?>
</span>
                              </a>
                           <?php 
                                }
                                ?>
                        </p>
                       <?php 
                            } elseif ($instance['excerpt'] == 'content') {
                                ?>
                        <p class="post-excerpt">
                           <?php 
                                the_content();
                                ?>
                           <?php 
                                if ($instance["mreadmore"] == 'after') {
                                    ?>
                           <a href="<?php 
                                    the_permalink();
                                    ?>
" class="readmorecontent" >
                              <span><?php 
                                    _e($instance["rmtext"], THEME_LANG_DOMAIN);
                                    ?>
</span>
                           </a>
                           <?php 
                                }
                                ?>
                        </p>
                       <?php 
                            }
                            ?>
                       <?php 
                            if ($instance["mmeta"] == 'atext') {
                                echo $this->blog_multimeta($instance);
                            }
                            if ($instance["mcats"] == 'acontent') {
                                $_tax = array();
                                $tax = array();
                                $_tax = get_the_taxonomies();
                                if (empty($_tax)) {
                                } else {
                                    foreach ($_tax as $key => $value) {
                                        preg_match('/(.+?): /i', $value, $matches);
                                        $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>';
                                    }
                                }
                                echo '<div class="post-meta taxonomy">' . join('<br />', $tax) . '</div>';
                            }
                            if ($instance["mreadmore"] != 'false' && $instance["mreadmore"] != 'after') {
                                ?>
                           <p style="text-align:<?php 
                                echo $instance["mreadmore"];
                                ?>
">
                           <a href="<?php 
                                the_permalink();
                                ?>
" class="readmorecontent" >
                              <span><?php 
                                _e($instance["rmtext"], THEME_LANG_DOMAIN);
                                ?>
</span>
                           </a>
                           </p>
                       <?php 
                            }
                            ?>
                       </div>
                       </div>
                       </div>



                    <?php 
                            if ($i == 1) {
                                echo '<div style="clear:both"></div>';
                            }
                        }
                    }
                }
                // MainIF Finish end multi post
                echo '<div style="clear:both"></div>';
                ?>
        <?php 
                if (function_exists('wp_pagenavi')) {
                    wp_pagenavi();
                }
                ?>
        </div>
        <?php 
            }
        }
    }
Ejemplo n.º 21
0
	function blog_multimeta( $instance ) {
		global $post;
		if ( $instance["mdate"] == 'true' ) {
			$mshowtime = isset( $instance['mshowtime'] ) ? $instance['mshowtime'] : '';
			if ( $mshowtime ) {
				$mtime = the_time();
			}
			$out[] = '<span class="date"><a href="' . get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) . '">' . get_the_date() . ' ' . $mtime . '</a></span>';
		}
		if ( $instance["mauthor"] == 'true' ) {
			$out[] = '<span class="author">' . __( 'by ', 'ultimatum' ) . '<a href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . get_the_author() . '</a></span>';
		}
		if ( $instance["mcomments"] == "true" && ( $post->comment_count > 0 || comments_open() ) ) {
			ob_start();
			comments_popup_link( __( 'No Comments', 'ultimatum' ), __( '1 Comment', 'ultimatum' ), __( '% Comments', 'ultimatum' ), '' );
			$out[] = '<span class="comments">' . ob_get_clean() . '</span>';
		}
		if ( count( $out ) != 0 ) {
			$output = '<div class="post-meta">';
			$output .= join( ' ' . $instance["mmseperator"] . ' ', $out ) . '</div>';
		}
		unset( $out );
		$tax = '';
		if ( $instance["mcats"] == 'ameta' ) {
			$_tax = get_the_taxonomies();
			if ( empty( $_tax ) ) {
			} else {
				foreach ( $_tax as $key => $value ) {
					preg_match( '/(.+?): /i', $value, $matches );
					$tax[] = '<span class="entry-tax-' . $key . '">' . str_replace( $matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value ) . '</span>';
				}
			}
			if ( count( $tax ) != 0 ) {
				$output .= '<div class="post-taxonomy">' . join( '<br />', $tax ) . '</div>';
			}
			unset( $_tax );
		}

		return $output;
	}
Ejemplo n.º 22
0
function get_breadcrumb_list($include_category = 1, $include_tag = 1, $include_taxonomy = 1)
{
    // ベースパンくず(サイト名など)
    $base_breadcrumb = '<li><a href="' . get_home_url() . '">サイト名など</a></li>';
    $top_url = get_home_url(null, '/');
    // ループ外対応
    global $query_string;
    global $post;
    query_posts($query_string);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
        }
    }
    // クエリリセットする
    wp_reset_query();
    // ページ数を取得(ページ数(0の場合は1ページ目なので1に変更する))
    if (get_query_var('paged') == 0) {
        $page = 1;
    } else {
        $page = get_query_var('paged');
    }
    // 投稿・固定ページかつアタッチメントページ以外の場合
    if (is_singular() && !is_attachment()) {
        // 記事についているカテゴリを全て取得する
        $categories = get_the_category();
        // カテゴリがある場合に実行する
        if (!empty($categories)) {
            $category_count = count($categories);
            $loop = 1;
            $category_list = '';
            foreach ($categories as $category) {
                // 値が1だったら、URLにカテゴリーのタクソノミーを含めて変数に格納する。
                if ($include_category === 1) {
                    $category_list .= '<a href="' . $top_url . esc_html($category->taxonomy) . '/' . esc_html($category->slug) . '/">' . esc_html($category->name) . '</a>';
                } else {
                    $category_list .= '<a href="' . $top_url . esc_html($category->slug) . '/">' . esc_html($category->name) . '</a>';
                }
                // ループの最後でない場合のみスラッシュ追加(複数カテゴリ対応)
                if ($loop != $category_count) {
                    $category_list .= ' / ';
                }
                ++$loop;
            }
        } else {
            $category_list = null;
        }
        // 記事についているタグを全て取得する
        $tags = get_the_tags();
        // タグがあれば実行する
        if (!empty($tags)) {
            $tags_count = count($tags);
            $loop = 1;
            $tag_list = '';
            foreach ($tags as $tag) {
                // 値が1だったら、URLにタグのタクソノミーを含めて変数に格納する。
                if ($include_tag === 1) {
                    $tag_list .= '<a href="' . $top_url . esc_html($tag->taxonomy) . '/' . esc_html($tag->slug) . '/">' . esc_html($tag->name) . '</a>';
                } else {
                    $tag_list .= '<a href="' . $top_url . esc_html($tag->slug) . '/">' . esc_html($tag->name) . '</a>';
                }
                // ループの最後でない場合のみスラッシュ追加(複数タグ対応)
                if ($loop !== $tags_count) {
                    $tag_list .= ' / ';
                }
                ++$loop;
            }
        } else {
            $tag_list = null;
        }
        // タクソノミーを全て取得する
        $taxonomies = get_the_taxonomies();
        // タクソノミーがある場合に実行する
        if (!empty($taxonomies)) {
            $term_list = '';
            $taxonomies_count = count($taxonomies);
            $taxonomies_loop = 1;
            foreach (array_keys($taxonomies) as $key) {
                // タームを取得
                $terms = get_the_terms($post->ID, $key);
                $terms_count = count($terms);
                $loop = 1;
                foreach ($terms as $term) {
                    // 値が1だったら、URLにタクソノミーを含めて変数に格納する。
                    if ($include_taxonomy === 1) {
                        $term_list .= '<a href="' . $top_url . esc_html($term->taxonomy) . '/' . esc_html($term->slug) . '/">' . esc_html($term->name) . '</a>';
                    } else {
                        $term_list .= '<a href="' . $top_url . esc_html($term->slug) . '/">' . esc_html($term->name) . '</a>';
                    }
                    // ループの最後でない場合のみスラッシュ追加(複数ターム対応)
                    if ($loop != $terms_count) {
                        $term_list .= ' / ';
                    }
                    ++$loop;
                }
                // ループの最後でない場合のみスラッシュ追加(複数タクソノミー対応)
                if ($taxonomies_loop != $taxonomies_count) {
                    $term_list .= ' / ';
                }
                ++$taxonomies_loop;
            }
        } else {
            $term_list = null;
        }
    }
    // 基本パンくずリストを変数に格納する。
    $breadcrumb_lists = $base_breadcrumb;
    // ホームの場合
    if (is_home()) {
        // 基本パンくずリストを上書きする
        $breadcrumb_lists = '<li>サイト名など</li>';
    } elseif (is_post_type_archive()) {
        // ページ数が1より大きい場合(○ページ目)を追加して格納する
        if ($page > 1) {
            $breadcrumb_lists .= '<li>' . esc_html(get_post_type_object(get_post_type())->label) . 'の記事一覧(' . $page . 'ページ目)</li>';
        } else {
            $breadcrumb_lists .= '<li>' . esc_html(get_post_type_object(get_post_type())->label) . 'の記事一覧</li>';
        }
    } elseif (is_archive()) {
        // 年アーカイブの場合
        if (is_year()) {
            // ページ数が1より大きい場合(○ページ目)を追加して格納する
            if ($page > 1) {
                $breadcrumb_lists .= '<li>' . esc_html(get_the_time("Y年")) . 'の記事一覧(' . $page . 'ページ目)</li>';
            } else {
                $breadcrumb_lists .= '<li>' . esc_html(get_the_time("Y年")) . 'の記事一覧</li>';
            }
        } elseif (is_month()) {
            // ページ数が1より大きい場合(○ページ目)を追加して格納する
            if ($page > 1) {
                $breadcrumb_lists .= '<li>' . esc_html(get_the_time("Y年m月")) . 'の記事一覧(' . $page . 'ページ目)</li>';
            } else {
                $breadcrumb_lists .= '<li>' . esc_html(get_the_time("Y年m月")) . 'の記事一覧</li>';
            }
        } elseif (is_day()) {
            // ページ数が1より大きい場合(○ページ目)を追加して格納する
            if ($page > 1) {
                $breadcrumb_lists .= '<li>' . esc_html(get_the_time("Y年m月d日")) . 'の記事一覧(' . $page . 'ページ目)</li>';
            } else {
                $breadcrumb_lists .= '<li>' . esc_html(get_the_time("Y年m月d日")) . 'の記事一覧</li>';
            }
        } elseif (is_category()) {
            // ページ数が1より大きい場合(○ページ目)を追加して格納する
            if ($page > 1) {
                $breadcrumb_lists .= '<li>' . esc_html(single_cat_title('', false)) . 'の記事一覧(' . $page . 'ページ目)</li>';
            } else {
                $breadcrumb_lists .= '<li>' . esc_html(single_cat_title('', false)) . 'の記事一覧</li>';
            }
        } elseif (is_tag()) {
            // ページ数が1より大きい場合(○ページ目)を追加して格納する
            if ($page > 1) {
                $breadcrumb_lists .= '<li>' . esc_html(single_tag_title('', false)) . 'の記事一覧(' . $page . 'ページ目)</li>';
            } else {
                $breadcrumb_lists .= '<li>' . esc_html(single_tag_title('', false)) . 'の記事一覧</li>';
            }
        } elseif (is_tax()) {
            // ページ数が1より大きい場合(○ページ目)を追加して格納する
            if ($page > 1) {
                $breadcrumb_lists .= '<li>' . esc_html(single_term_title('', false)) . 'の記事一覧(' . $page . 'ページ目)</li>';
            } else {
                $breadcrumb_lists .= '<li>' . esc_html(single_term_title('', false)) . 'の記事一覧</li>';
            }
        }
    } elseif (is_single()) {
        // ページ数を取得(ページ数(0の場合は1ページ目なので1に変更する))
        if (get_query_var('page') == 0) {
            $page = 1;
        } else {
            $page = get_query_var('page');
        }
        // 通常投稿の場合
        if (get_post_type() === 'post') {
            // カスタムフィールドの値を取得
            $seo_title = esc_html(get_post_meta($post->ID, 'seo_title', true));
            // カテゴリがある場合のみ追加
            if (!empty($category_list)) {
                $breadcrumb_lists .= '<li>' . $category_list . '</li>';
            }
            // タグがある場合のみ追加
            if (!empty($tag_list)) {
                $breadcrumb_lists .= '<li>' . $tag_list . '</li>';
            }
            // 2ページ目以降の場合
            if ($page > 1) {
                // カスタムフィールドに値があったらその値を格納する
                if (!empty($seo_title)) {
                    $breadcrumb_lists .= '<li>' . $seo_title . '</li>';
                } else {
                    // ページが分割されている場合のタイトル取得
                    if (function_exists('get_current_split_string')) {
                        $split_title = esc_html(get_current_split_string($page));
                    } else {
                        $split_title = null;
                    }
                    // ページが分割されている場合のタイトルがあった場合はそれを加える
                    if (!empty($split_title)) {
                        $breadcrumb_lists .= '<li>' . esc_html(get_the_title()) . '【' . $split_title . '】</li>';
                    } else {
                        $breadcrumb_lists .= '<li>' . esc_html(get_the_title()) . '(' . $page . 'ページ目)</li>';
                    }
                }
            } else {
                // カスタムフィールドに値があったらその値を格納する
                if (!empty($seo_title)) {
                    $breadcrumb_lists .= '<li>' . $seo_title . '</li>';
                } else {
                    $breadcrumb_lists .= '<li>' . esc_html(get_the_title()) . '</li>';
                }
            }
        } else {
            // タームがある場合のみ追加
            if (!empty($term_list)) {
                $breadcrumb_lists .= '<li>' . $term_list . '</li>';
            }
            $breadcrumb_lists .= '<li>' . esc_html(get_the_title()) . '</li>';
        }
    } elseif (is_page()) {
        $breadcrumb_lists .= '<li>' . esc_html(get_the_title()) . '</li>';
    } elseif (is_search()) {
        // ページ数が1より大きい場合(○ページ目)を追加して格納する
        if ($page > 1) {
            $breadcrumb_lists .= '<li>「' . esc_html(get_search_query()) . '」で検索した結果(' . $page . 'ページ目)</li>';
        } else {
            $breadcrumb_lists .= '<li>「' . esc_html(get_search_query()) . '」で検索した結果</li>';
        }
    } elseif (is_404()) {
        $breadcrumb_lists .= '<li>お探しのページは見つかりませんでした</li>';
    } else {
        $breadcrumb_lists = $base_breadcrumb;
    }
    // パンくずリスト成形
    if (!empty($breadcrumb_lists)) {
        $breadcrumb_lists = '<ul id="breadcrumb_list">' . $breadcrumb_lists . '</ul>';
    }
    return $breadcrumb_lists;
}
Ejemplo n.º 23
0
/**
 * Display the taxonomies of a post with available options.
 *
 * This function can be used within the loop to display the taxonomies for a
 * post without specifying the Post ID. You can also use it outside the Loop to
 * display the taxonomies for a specific post.
 *
 * @since 2.5.0
 *
 * @param array $args {
 *     Arguments about which post to use and how to format the output. Shares all of the arguments
 *     supported by get_the_taxonomies(), in addition to the following.
 *
 *     @type  int|WP_Post $post   Post ID or object to get taxonomies of. Default current post.
 *     @type  string      $before Displays before the taxonomies. Default empty string.
 *     @type  string      $sep    Separates each taxonomy. Default is a space.
 *     @type  string      $after  Displays after the taxonomies. Default empty string.
 * }
 * @param array $args See {@link get_the_taxonomies()} for a description of arguments and their defaults.
 */
function the_taxonomies($args = array())
{
    $defaults = array('post' => 0, 'before' => '', 'sep' => ' ', 'after' => '');
    $r = wp_parse_args($args, $defaults);
    echo $r['before'] . join($r['sep'], get_the_taxonomies($r['post'], $r)) . $r['after'];
}
Ejemplo n.º 24
0
		<div id="<?php 
    echo $taxonomy;
    ?>
-all">
			<?php 
    $name = $taxonomy == 'category' ? 'post_category' : 'tax_input[' . $taxonomy . ']';
    echo "<input type='hidden' name='{$name}[]' value='0' />";
    // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    ?>
			<ul>
				<?php 
    wp_terms_checklist($post->ID, array('taxonomy' => $taxonomy, 'popular_cats' => false, 'checked_ontop' => false, 'walker' => new mymail_Walker_Category_Checklist()));
    ?>
			</ul>
		</div>
		
		<p class="totals"><?php 
    _e('Total receivers', 'mymail');
    ?>
: <span id="mymail_total"></span></p>
		
	</div>
<?php 
} else {
    $tax = get_the_taxonomies($post->ID, 'template=%2$l');
    if (isset($tax['newsletter_lists'])) {
        echo strip_tags($tax['newsletter_lists']);
    } else {
        _e('no lists selected', 'mymail');
    }
}