本文整理汇总了PHP中the_id函数的典型用法代码示例。如果您正苦于以下问题:PHP the_id函数的具体用法?PHP the_id怎么用?PHP the_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hm_sort_slides
/**
* Display slide Sort admin
*
* @author Soul
**/
function hm_sort_slides()
{
$slide = new WP_Query('post_type=slide&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<h3>Sort Slides <img src="<?php
echo home_url();
?>
/wp-admin/images/loading.gif" id="loading-animation" /></h3>
<ul id="video-list">
<?php
while ($slide->have_posts()) {
$slide->the_post();
?>
<li id="<?php
the_id();
?>
"><?php
echo the_post_thumbnail(array(60, 60));
?>
<?php
the_title();
?>
</li>
<?php
}
?>
</div><!-- End div#wrap //-->
<?php
}
示例2: mvm_display_singer_list
function mvm_display_singer_list()
{
$args = array('post_type' => 'singer', 'posts_per_page' => -1, 'post_status' => 'published');
$singers = new WP_Query($args);
if ($singers->have_posts()) {
?>
<ul class="mvm_singers_list">
<?php
while ($singers->have_posts()) {
$singers->the_post();
?>
<li id="singer-<?php
the_id();
?>
" class="mvm_singer" singer-id="<?php
the_id();
?>
">
<?php
the_title();
?>
</li>
<?php
}
wp_reset_postdata();
?>
</ul>
<?php
}
}
示例3: mtheme_sort_portfolio
/**
* Display Sort admin
*
* @return void
* @author Soul
**/
function mtheme_sort_portfolio()
{
$portfolio = new WP_Query('post_type=mtheme_portfolio&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<h2>Sort portfolio Slides<img src="<?php
echo home_url();
?>
/wp-admin/images/loading.gif" id="loading-animation" /></h2>
<div class="description">
Drag and Drop the slides to order them
</div>
<ul id="portfolio-list">
<?php
while ($portfolio->have_posts()) {
$portfolio->the_post();
?>
<li id="<?php
the_id();
?>
">
<div>
<?php
$image_url = wp_get_attachment_thumb_url(get_post_thumbnail_id());
$custom = get_post_custom(get_the_ID());
$portfolio_cats = get_the_terms(get_the_ID(), 'types');
?>
<?php
if ($image_url) {
echo '<img class="mtheme_admin_sort_image" src="' . $image_url . '" width="30px" height="30px" alt="" />';
}
?>
<span class="mtheme_admin_sort_title"><?php
the_title();
?>
</span>
<?php
if ($portfolio_cats) {
?>
<span class="mtheme_admin_sort_categories"><?php
foreach ($portfolio_cats as $taxonomy) {
echo ' | ' . $taxonomy->name;
}
?>
</span>
<?php
}
?>
</div>
</li>
<?php
}
?>
</div><!-- End div#wrap //-->
<?php
}
示例4: omtm_testimonials_sort_page
function omtm_testimonials_sort_page()
{
$query = new WP_Query('post_type=testimonials&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<div id="icon-edit-pages" class="icon32 icon32-posts-page"><br /></div>
<h2><?php
_e('Sort Testimonials', 'om_testimonials');
?>
</h2>
<p><?php
_e('Sort Testimonials by drag-n-drop. Items at the top will appear first.', 'om_testimonials');
?>
</p>
<ul id="omtm_testimonials_items">
<?php
while ($query->have_posts()) {
$query->the_post();
?>
<?php
if (get_post_status() == 'publish') {
?>
<li id="<?php
the_id();
?>
" class="menu-item">
<dl class="menu-item-bar">
<dt class="menu-item-handle">
<span class="menu-item-title"><?php
the_title();
?>
</span>
</dt>
</dl>
<ul class="menu-item-transport"></ul>
</li>
<?php
}
?>
<?php
}
?>
</ul>
</div>
<script>
jQuery(function($){
omtm_items_sort('#omtm_testimonials_items','omtm_testimonials_apply_sort');
});
</script>
<?php
wp_reset_postdata();
?>
<?php
}
示例5: hide_case_studies
function hide_case_studies()
{
$the_page_id = the_id();
$ids_to_hide = array(182);
$should_hide = false;
foreach ($ids_to_hide as $id) {
if ($the_page_id == id) {
$should_hide == true;
}
}
return $should_hide;
}
示例6: reorder_admin_jobs_callback
function reorder_admin_jobs_callback()
{
$args = array('post_type' => 'job', 'orderby' => 'menu_order', 'order' => 'ASC', 'post_status' => 'publish', 'no_found_rows' => true, 'update_post_term_cache' => false, 'post_per_post' => 50);
$job_listing = new WP_Query($args);
?>
<div id="job-sort" class="wrap">
<div id="icon-job-admin" class="icon32"><br /></div>
<h2><?php
_e('Sort Job Positions', 'wp-job-listing');
?>
<img src="<?php
echo esc_url(admin_url() . '/images/loading.gif');
?>
" id="loading-animation"></h2>
<?php
if ($job_listing->have_posts()) {
?>
<p><?php
_e('<strong>Note:</strong> this only affects the Jobs listed using the shortcode functions', 'wp-job-listing');
?>
</p>
<ul id="custom-type-list">
<?php
while ($job_listing->have_posts()) {
$job_listing->the_post();
?>
<li id="<?php
esc_attr(the_id());
?>
"><?php
esc_html(the_title());
?>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<p><?php
_e('You have no Jobs to sort.', 'wp-job-listing');
?>
</p>
<?php
}
?>
</div>
<?php
}
示例7: theme_portfolio_sort
function theme_portfolio_sort()
{
$portfolios = new WP_Query('post_type=portfolio&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<div id="icon-tools" class="icon32"><br /></div>
<h2><?php
_e('Sort Portfolio Items', 'framework');
?>
</h2>
<p><?php
_e('Drag portfolio items to organize.', 'framework');
?>
</p>
<ul id="portfolio_list">
<?php
while ($portfolios->have_posts()) {
$portfolios->the_post();
?>
<?php
if (get_post_status() == 'publish') {
?>
<li id="<?php
the_id();
?>
" class="menu-item">
<dl class="menu-item-bar">
<dt class="menu-item-handle">
<span class="menu-item-title"><?php
the_title();
?>
</span>
</dt>
</dl>
<ul class="menu-item-transport"></ul>
</li>
<?php
}
?>
<?php
}
?>
<?php
wp_reset_postdata();
?>
</ul>
</div>
<?php
}
示例8: tpp_posts_widget
function tpp_posts_widget()
{
$tpp_posts_query = new WP_Query('&posts_per_page=10&orderby=comment_count&order=DESC');
?>
<h3><?php
_e('Top Posts:');
?>
</h3>
<?php
if ($tpp_posts_query->have_posts()) {
while ($tpp_posts_query->have_posts()) {
$tpp_posts_query->the_post();
?>
<div class="tpp_posts">
<a href="<?php
echo the_permalink();
?>
"
id="<?php
echo the_id();
?>
"
title="<?php
echo the_title();
?>
"
class="comment_link"><?php
echo the_title();
?>
</a>
(<?php
echo comments_number();
?>
)
</div>
<?php
}
}
?>
<?php
}
示例9: top_post
function top_post()
{
$query = new WP_Query(array('posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC'));
?>
<h3>Posts on this page</h3>
<ul>
<?php
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post();
?>
<div class="tpp_posts">
<a href="<?php
echo the_permalink();
?>
"
id="<?php
echo the_id();
?>
"
title="<?php
echo the_title();
?>
"
class="comment_link"><?php
echo the_title();
?>
</a>
(<?php
echo comments_number();
?>
)
</div>
<?php
}
}
?>
</ul>
<?php
}
示例10: rah_get_secret_groups_ajax
function rah_get_secret_groups_ajax()
{
$sg_query = new WP_Query("post_type=groups&orderby=title&order=ASC&posts_per_page=-1&meta_key=_rah_secret_group&meta_value=1");
if ($sg_query->have_posts()) {
?>
<p id="existing_secret">
<select id="existing_groups" name="existing_secret_group">
<option value="-1">Select A Group</option>
<?php
while ($sg_query->have_posts()) {
$sg_query->the_post();
?>
<option value="<?php
the_id();
?>
"><?php
the_title();
?>
</option><?php
}
?>
</select> <input type="checkbox" id="group_not_listed" name="group_not_listed" value="1"> <label for="group_not_listed">My Group Isn't Listed</label>
</p>
<p id="new_secret_group" style="display:none;">
<input type="text" size="50" id="new_secret_group_title" name="new_secret_group_title" value="" placeholder="Your Group Name">
<textarea name="new_secret_group_description" placeholder="Group Description. You can copy this from your Facebook Group."></textarea>
</p>
<?php
} else {
?>
<p id="new_secret_group">
<input type="hidden" name="group_not_listed" value="1" />
<input type="text" size="50" id="new_secret_group_title" name="new_secret_group_title" value="" placeholder="Your Group Name">
<textarea name="new_secret_group_description" placeholder="Group Description. You can copy this from your Facebook Group."></textarea>
</p>
<?php
}
die;
}
示例11: jwt_a_f_p_posts_sort_callback
function jwt_a_f_p_posts_sort_callback()
{
$faq = new WP_Query('post_type=faq&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<h3>Sort FAQ<img src="<?php
echo home_url();
?>
/wp-admin/images/loading.gif" id="loading-animation" /></h3>
<ul id="slide-list">
<?php
if ($faq->have_posts()) {
?>
<?php
while ($faq->have_posts()) {
$faq->the_post();
?>
<li id="<?php
the_id();
?>
"><?php
the_title();
?>
</li>
<?php
}
?>
<?php
} else {
?>
<li>There is no FAQ was Created !!!</li>
<?php
}
?>
</ul>
</div>
<?php
}
示例12: client_posts_sort_callback
function client_posts_sort_callback()
{
$clients = new WP_Query('post_type=client&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<h3>Sort Clients<img src="<?php
echo home_url();
?>
/wp-admin/images/loading.gif" id="loading-animation" /></h3>
<ul id="slide-list">
<?php
if ($clients->have_posts()) {
?>
<?php
while ($clients->have_posts()) {
$clients->the_post();
?>
<li id="<?php
the_id();
?>
"><?php
the_title();
?>
</li>
<?php
}
?>
<?php
} else {
?>
<li>There is no Slide Created</li>
<?php
}
?>
</ul>
</div>
<?php
}
示例13: sort_quotes_custom_1
function sort_quotes_custom_1()
{
$quotes = new WP_Query('post_type=quotes-custom-1&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<div id="icon-tools" class="icon32"><br /></div>
<h2><?php
_e('Sort Quote Items', 'nash');
?>
<img src="<?php
echo home_url();
?>
/wp-admin/images/loading.gif" id="loading-animation" /></h2>
<p><?php
_e('Click, drag, re-order. Repeat as neccessary. Quote item at the top will appear first on your page.', 'nash');
?>
</p>
<ul id="post-list">
<?php
while ($quotes->have_posts()) {
$quotes->the_post();
?>
<li id="<?php
the_id();
?>
"><?php
the_title();
?>
</li>
<?php
}
?>
</div>
<?php
}
示例14: sort_team
function sort_team()
{
$team = new WP_Query('post_type=team&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div class="wrap">
<div id="icon-tools" class="icon32"><br /></div>
<h2><?php
_e('Sort Team Members', 'kula');
?>
<img src="<?php
echo home_url();
?>
/wp-admin/images/loading.gif" id="loading-animation" /></h2>
<p><?php
_e('Click, drag, re-order. Repeat as neccessary. Team Member at the top will appear first on your page.', 'kula');
?>
</p>
<ul id="post-list">
<?php
while ($team->have_posts()) {
$team->the_post();
?>
<li id="<?php
the_id();
?>
"><?php
the_title();
?>
</li>
<?php
}
?>
</div>
<?php
}
示例15: sort_page
/**
* Sort Page
*
* @return WP_FAQ_Manager
*/
public function sort_page()
{
$questions = new WP_Query('post_type=question&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
<div id="faq-admin-sort" class="wrap">
<div id="icon-faq-admin" class="icon32"><br /></div>
<h2><?php
_e('Sort FAQs', 'wpfaq');
?>
<img src=" <?php
echo admin_url();
?>
/images/loading.gif" id="loading-animation" /></h2>
<?php
if ($questions->have_posts()) {
?>
<p><?php
_e('<strong>Note:</strong> this only affects the FAQs listed using the shortcode functions', 'wpfaq');
?>
</p>
<ul id="custom-type-list">
<?php
while ($questions->have_posts()) {
$questions->the_post();
?>
<li id="<?php
the_id();
?>
"><?php
the_title();
?>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<p><?php
_e('You have no FAQs to sort.', 'wpfaq');
?>
</p>
<?php
}
?>
</div>
<?php
}