本文整理汇总了PHP中tf_addUrlParameter函数的典型用法代码示例。如果您正苦于以下问题:PHP tf_addUrlParameter函数的具体用法?PHP tf_addUrlParameter怎么用?PHP tf_addUrlParameter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tf_addUrlParameter函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: next_post_link_plus
}
?>
<?php
if ($portfolioID || $categoryID) {
$next_post_link = next_post_link_plus(array('format' => '%link', 'link' => __('Next', 'Avada'), 'in_same_tax' => 'portfolio_category', 'in_cats' => $nav_categories, 'return' => 'href'));
} else {
$next_post_link = next_post_link_plus(array('format' => '%link', 'link' => __('Next', 'Avada'), 'return' => 'href'));
}
?>
<?php
if ($next_post_link) {
if ($portfolioID || $categoryID) {
if ($portfolioID) {
$next_post_link = tf_addUrlParameter($next_post_link, 'portfolioID', $portfolioID);
} else {
$next_post_link = tf_addUrlParameter($next_post_link, 'categoryID', $categoryID);
}
}
?>
<a href="<?php
echo $next_post_link;
?>
" rel="next"><?php
_e('Next', 'Avada');
?>
</a>
<?php
}
?>
</div>
<?php
示例2: get_post_meta
$custom_colulmn_spacing = false;
if (get_post_meta($post->ID, 'pyre_portfolio_column_spacing', true) || get_post_meta($post->ID, 'pyre_portfolio_column_spacing', true) === '0') {
$custom_colulmn_spacing = true;
$col_spacing = get_post_meta($post->ID, 'pyre_portfolio_column_spacing', true) / 2;
echo sprintf('<style type="text/css">.portfolio-wrapper{margin: 0 %spx;}.portfolio-wrapper .col-spacing{padding:%spx;}</style>', -1 * $col_spacing, $col_spacing);
} else {
if ($smof_data['portfolio_column_spacing']) {
$custom_colulmn_spacing = true;
$col_spacing = $smof_data['portfolio_column_spacing'] / 2;
echo sprintf('<style type="text/css">.portfolio-wrapper{margin: 0 %spx;}.portfolio-wrapper .col-spacing{padding:%spx;}</style>', -1 * $col_spacing, $col_spacing);
}
}
while ($gallery->have_posts()) {
$gallery->the_post();
if ($pcats) {
$permalink = tf_addUrlParameter(get_permalink(), 'portfolioID', $current_page_id);
} else {
$permalink = get_permalink();
}
if (has_post_thumbnail() || get_post_meta($post->ID, 'pyre_video', true)) {
?>
<?php
$item_classes = $portfolio_text_layout;
$item_cats = get_the_terms($post->ID, 'portfolio_category');
if ($item_cats) {
foreach ($item_cats as $item_cat) {
$item_classes .= urldecode($item_cat->slug) . ' ';
}
}
if ($custom_colulmn_spacing) {
$item_classes .= ' col-spacing';
示例3: while
<?php
while (have_posts()) {
the_post();
if (has_post_thumbnail()) {
?>
<?php
$item_classes = '';
$item_cats = get_the_terms($post->ID, 'portfolio_category');
if ($item_cats) {
foreach ($item_cats as $item_cat) {
$item_classes .= $item_cat->slug . ' ';
}
}
$queried_object = get_queried_object();
$term_id = $queried_object->term_id;
$permalink = tf_addUrlParameter(get_permalink(), 'categoryID', $term_id);
?>
<div class="portfolio-item <?php
echo $item_classes;
?>
">
<div class="image">
<?php
if ($data['image_rollover']) {
?>
<?php
the_post_thumbnail('portfolio-one');
?>
<?php
} else {
?>