• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP theme_get_post_id函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中theme_get_post_id函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_get_post_id函数的具体用法?PHP theme_get_post_id怎么用?PHP theme_get_post_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了theme_get_post_id函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: theme_post_wrapper

<?php

/**
 *
 * content*.php
 *
 * The post format template. You can change the structure of your posts or add/remove post elements here.
 * 
 * 'id' - post id
 * 'class' - post class
 * 'thumbnail' - post icon
 * 'title' - post title
 * 'before' - post header metadata
 * 'content' - post content
 * 'after' - post footer metadata
 * 
 * To create a new custom post format template you must create a file "content-YourTemplateName.php"
 * Then copy the contents of the existing content.php into your file and edit it the way you want.
 * 
 * Change an existing get_template_part() function as follows:
 * get_template_part('content', 'YourTemplateName');
 *
 */
global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_page_title') ? get_the_title() : '', 'heading' => theme_get_option('theme_single_article_title_tag'), 'before' => theme_get_metadata_icons('edit', 'header'), 'content' => theme_get_content()));
?>

开发者ID:numfocus,项目名称:website,代码行数:26,代码来源:content-page.php


示例2: wp_get_attachment_url

    // filterable image width with, essentially, no limit for image height.
    ?>
		</a>
	</p>
	<?php 
} else {
    ?>
	<p class="attachment center">
		<a href="<?php 
    echo wp_get_attachment_url();
    ?>
" title="<?php 
    echo esc_attr(strip_tags(get_the_title()));
    ?>
" rel="attachment">
			<?php 
    echo basename(get_permalink());
    ?>
		</a>
	</p>
	<?php 
}
echo theme_get_content();
if (wp_attachment_is_image()) {
    $metadata = wp_get_attachment_metadata();
    echo '<p class="center">' . sprintf(__('Full size is %s pixels', THEME_NS), sprintf('<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>', wp_get_attachment_url(), esc_attr(__('Link to full-size image', THEME_NS)), $metadata['width'], $metadata['height'])) . '</p>';
}
/* Display navigation to next/previous pages when applicable */
theme_post_navigation(array('wrap' => false, 'prev_link' => theme_get_next_image_link(false), 'next_link' => theme_get_previous_image_link(false)));
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => '<a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . strip_tags(get_the_title()) . '">' . get_the_title() . '</a>', 'heading' => theme_get_option('theme_' . (is_home() ? 'posts' : 'single') . '_article_title_tag'), 'before' => theme_get_metadata_icons('date,author,edit', 'header'), 'content' => theme_ob_get_clean()));
开发者ID:spadwen,项目名称:shop.bentleigh-discount-lolly.com.au,代码行数:30,代码来源:content-attachment.php


示例3: theme_post_wrapper

<?php

/**
 *
 * content*.php
 *
 * The post format template. You can change the structure of your posts or add/remove post elements here.
 * 
 * 'id' - post id
 * 'class' - post class
 * 'thumbnail' - post icon
 * 'title' - post title
 * 'before' - post header metadata
 * 'content' - post content
 * 'after' - post footer metadata
 * 
 * To create a new custom post format template you must create a file "content-YourTemplateName.php"
 * Then copy the contents of the existing content.php into your file and edit it the way you want.
 * 
 * Change an existing get_template_part() function as follows:
 * get_template_part('content', 'YourTemplateName');
 *
 */
global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_post_title') ? '<a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . strip_tags(get_the_title()) . '">' . get_the_title() . '</a>' : '', 'heading' => theme_get_option('theme_posts_article_title_tag'), 'before' => theme_get_metadata_icons('date,author,edit', 'header'), 'content' => theme_highlight_excerpt(get_search_query(), theme_get_content()), 'after' => theme_get_metadata_icons('category,tag', 'footer')));
开发者ID:spadwen,项目名称:shop.bentleigh-discount-lolly.com.au,代码行数:25,代码来源:content-search.php


示例4: theme_post_wrapper

<?php

/**
 *
 * content*.php
 *
 * The post format template. You can change the structure of your posts or add/remove post elements here.
 * 
 * 'id' - post id
 * 'class' - post class
 * 'thumbnail' - post icon
 * 'title' - post title
 * 'before' - post header metadata
 * 'content' - post content
 * 'after' - post footer metadata
 * 
 * To create a new custom post format template you must create a file "content-YourTemplateName.php"
 * Then copy the contents of the existing content.php into your file and edit it the way you want.
 * 
 * Change an existing get_template_part() function as follows:
 * get_template_part('content', 'YourTemplateName');
 *
 */
global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_post_title') ? get_the_title() : '', 'heading' => theme_get_option('theme_single_article_title_tag'), 'before' => theme_get_metadata_icons('date,author,edit', 'header'), 'content' => theme_get_content(), 'after' => theme_get_metadata_icons('category,tag', 'footer')));
开发者ID:numfocus,项目名称:website,代码行数:25,代码来源:content-single.php


示例5: theme_post_wrapper

<?php

global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'thumbnail' => theme_get_post_thumbnail(), 'title' => '<a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . get_the_title() . '">' . get_the_title() . '</a>', 'before' => theme_get_metadata_icons('date,author,edit', 'header'), 'content' => theme_get_excerpt(), 'after' => theme_get_metadata_icons('category,tag,comments', 'footer')));
开发者ID:uniquegel,项目名称:Feminnova,代码行数:4,代码来源:content.php


示例6: theme_post_wrapper

<?php

/**
 *
 * content*.php
 *
 * The post format template. You can change the structure of your posts or add/remove post elements here.
 * 
 * 'id' - post id
 * 'class' - post class
 * 'thumbnail' - post icon
 * 'title' - post title
 * 'before' - post header metadata
 * 'content' - post content
 * 'after' - post footer metadata
 * 
 * To create a new custom post format template you must create a file "content-YourTemplateName.php"
 * Then copy the contents of the existing content.php into your file and edit it the way you want.
 * 
 * Change an existing get_template_part() function as follows:
 * get_template_part('content', 'YourTemplateName');
 *
 */
global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'content' => theme_get_excerpt(), 'after' => theme_get_metadata_icons('', 'footer')));
开发者ID:epiii,项目名称:Clean-Wordpress-theme,代码行数:25,代码来源:content-aside.php


示例7: theme_post_wrapper

<?php

/**
 *
 * content*.php
 *
 * The post format template. You can change the structure of your posts or add/remove post elements here.
 * 
 * 'id' - post id
 * 'class' - post class
 * 'thumbnail' - post icon
 * 'title' - post title
 * 'before' - post header metadata
 * 'content' - post content
 * 'after' - post footer metadata
 * 
 * To create a new custom post format template you must create a file "content-YourTemplateName.php"
 * Then copy the contents of the existing content.php into your file and edit it the way you want.
 * 
 * Change an existing get_template_part() function as follows:
 * get_template_part('content', 'YourTemplateName');
 *
 */
global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'content' => theme_get_excerpt(), 'after' => theme_get_metadata_icons('date,author,comments,edit', 'footer')));
开发者ID:numfocus,项目名称:website,代码行数:25,代码来源:content-aside.php


示例8: theme_is_current_screen

/**
 * Alternative to get_current_screen()
 * @link http://wordpress.stackexchange.com/a/174596/22728
 * 
 * @param  string $base      
 * @param  string $post_type 
 * @return bool
 */
function theme_is_current_screen($base = null, $post_type = null)
{
    if (!$base && !$post_type) {
        return false;
    }
    $screen = function_exists('get_current_screen') ? get_current_screen() : null;
    if (!$screen) {
        // Fake it.
        $screen = new StdClass();
        $screen->post_type = $screen->base = '';
        global $pagenow;
        if ($pagenow == 'admin-ajax.php') {
            if (isset($_REQUEST['action'])) {
                $screen->base = $_REQUEST['action'];
            }
        } else {
            $screen->post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : '';
            if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || $pagenow == 'edit.php') {
                $screen->base = preg_replace('/[^a-z].+$/', '', $pagenow);
                if (!$screen->post_type) {
                    $screen->post_type = get_post_type(theme_get_post_id());
                }
            } else {
                $page_hook = '';
                global $plugin_page;
                if (!empty($plugin_page)) {
                    if ($screen->post_type) {
                        $the_parent = $pagenow . '?post_type=' . $screen->post_type;
                    } else {
                        $the_parent = $pagenow;
                    }
                    if (!($page_hook = get_plugin_page_hook($plugin_page, $the_parent))) {
                        $page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
                    }
                }
                $screen->base = $page_hook ? $page_hook : pathinfo($pagenow, PATHINFO_FILENAME);
            }
        }
    }
    // The base type of the screen. This is typically the same as $id but with any post types and taxonomies stripped.
    if ($base) {
        if (!is_array($base)) {
            $base = array($base);
        }
        if (!in_array($screen->base, $base)) {
            return false;
        }
    }
    if ($post_type) {
        if (!is_array($post_type)) {
            $post_type = array($post_type);
        }
        if (!in_array($screen->post_type, $post_type)) {
            return false;
        }
    }
    return true;
}
开发者ID:bdwebteam,项目名称:WP-CodeSpring,代码行数:66,代码来源:functions.php


示例9: wp_get_attachment_url

    // filterable image width with, essentially, no limit for image height.
    ?>
				</a>
			</p>
			<?php 
} else {
    ?>
				<p class="attachment center">
					<a href="<?php 
    echo wp_get_attachment_url();
    ?>
" title="<?php 
    echo esc_attr(get_the_title());
    ?>
" rel="attachment">
						<?php 
    echo basename(get_permalink());
    ?>
					</a>
				</p>
			<?php 
}
echo theme_get_content();
if (wp_attachment_is_image()) {
    $metadata = wp_get_attachment_metadata();
    echo '<p class="center">' . sprintf(__('Full size is %s pixels', THEME_NS), sprintf('<a href="%1$s" title="%2$s">%3$s &times; %4$s</a>', wp_get_attachment_url(), esc_attr(__('Link to full-size image', THEME_NS)), $metadata['width'], $metadata['height'])) . '</p>';
}
/* Display navigation to next/previous pages when applicable */
theme_page_navigation(array('wrap' => false, 'prev_link' => theme_get_next_image_link(false), 'next_link' => theme_get_previous_image_link(false)));
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => '<a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . get_the_title() . '">' . get_the_title() . '</a>', 'before' => theme_get_metadata_icons('date,author,edit', 'header'), 'content' => ob_get_clean()));
开发者ID:uniquegel,项目名称:Feminnova,代码行数:30,代码来源:content-attachment.php


示例10: theme_post_wrapper

<?php

global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'title' => theme_get_meta_option($post->ID, 'theme_show_post_title') ? get_the_title() : '', 'content' => theme_get_content()));
开发者ID:uniquegel,项目名称:Feminnova,代码行数:4,代码来源:content-single.php


示例11: theme_post_wrapper

<?php

/**
 *
 * content*.php
 *
 * The post format template. You can change the structure of your posts or add/remove post elements here.
 * 
 * 'id' - post id
 * 'class' - post class
 * 'thumbnail' - post icon
 * 'title' - post title
 * 'before' - post header metadata
 * 'content' - post content
 * 'after' - post footer metadata
 * 
 * To create a new custom post format template you must create a file "content-YourTemplateName.php"
 * Then copy the contents of the existing content.php into your file and edit it the way you want.
 * 
 * Change an existing get_template_part() function as follows:
 * get_template_part('content', 'YourTemplateName');
 *
 */
global $post;
theme_post_wrapper(array('id' => theme_get_post_id(), 'class' => theme_get_post_class(), 'thumbnail' => theme_get_post_thumbnail(), 'title' => '<a href="' . get_permalink($post->ID) . '" rel="bookmark" title="' . strip_tags(get_the_title()) . '">' . get_the_title() . '</a>', 'heading' => theme_get_option('theme_' . (is_single() ? 'single' : 'posts') . '_article_title_tag'), 'before' => theme_get_metadata_icons('date,author,edit', 'header'), 'content' => theme_get_excerpt(), 'after' => theme_get_metadata_icons('category,tag,comments', 'footer')));
开发者ID:numfocus,项目名称:website,代码行数:25,代码来源:content.php



注:本文中的theme_get_post_id函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP theme_get_registry函数代码示例发布时间:2022-05-23
下一篇:
PHP theme_get_post_class函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap