您当前的位置:首页 > TAG信息列表 > post-formats

  • 重写子主题中的后置格式

    时间:2016-06-23

    我使用的子主题只有video post格式,但父主题定义了所有post格式:add_theme_support( \'post-formats\', array( \'gallery\', \'link\', \'image\', \'quote\', \'video\', \'audio\', \'chat\' ) );我试过:remove_theme_support( \'post-formats\' ); add_theme_support( \'post-formats\', array(

  • 删除开机自检格式(类型)辅助文件

    时间:2016-08-09

    在尝试删除post格式slug时遇到了问题,因此我可以使用示例。com/video用于视频部分,而不是示例。com/类型/视频。通常是这样做的:add_action( \'init\', \'custom_format_permalinks\', 1 ); function custom_format_permalinks() { $taxonomy = \'post_format\'; $post_format_rewrite = array( \'slug

  • 静态变量循环在WordPress中不起作用

    时间:2016-09-15

    我的wordpress主题中有一个功能,可以删除视频帖子中的第一个嵌入视频。请参见下面的代码。这在函数中。php文件。/* - function that hides first video in post content - */ function process_embed( $embed ){ if ( is_single() && get_post_format() === \'video\' ) { static

  • Content-Single.php和Content-Single.php是一样的吗?

    时间:2016-09-15

    我明白当使用get_template_part(\'content\', get_post_format()); 这将有助于选择post format 对于特定页面,请根据帖子格式。如果没有“即标准”的post格式,那么它将回退到content.php但如果我用content-single.php 有这样的逻辑:if (get_post_format() == false) { get_template_part(\'content\', \'single\'); } el

  • 如果在标题或帖子内容中找到字符串,则设置帖子格式

    时间:2016-09-16

    我正在与ITFFF合作以创建帖子,但我对“帖子格式”有一个问题。如果标题或帖子内容中有一些特定字符串,我需要将帖子格式更改为图像。。我正在阅读论坛并收集一些代码来创建一个this。。但它不起作用。这是我的代码:add_action( \'save_post\', \'CambiarPostFormat\' ); function CambiarPostFormat( $postID ) { $a = get_the_title( $post_id );

  • 下一篇文章上一篇文章仅适用于标准文章格式

    时间:2016-10-05

    在我的single.php 文件显示上一篇和下一篇文章的链接:get_next_post(); get_previous_post(); 我将它们存储在两个变量中:$next_post = get_next_post(); $prev_post = get_previous_post(); 并在页面底部使用get_permalink:$next_post_url = get_permalink( $next_post->ID ); <a href=\

  • 如何为当前帖子格式添加meta box?

    时间:2016-11-30

    我想添加当前帖子格式的元框,比如当我选择视频帖子格式时,就会在帖子编辑器下面出现视频url输入帖子。如何做到这一点?任何帮助