如何在WordPress中为特定页面创建特定页脚?

所以-我一直在设法做到这一点, 并半途而废, 这真令人发指!

使用jetpack项目组合-我想在我的博客部分和帖子中显示常规类别, 并在项目组合页面和单个项目中显示jetpack项目类型。

我当前的代码如下所示, 并在archive-jetpack-portfolio上显示了第一篇文章的jetpack组合类型, 并正确显示在单个项目上。但对于博客帖子根本不起作用。

<?php 
  if (is_page_template('page-blog.php', 'single.php', 'index.php' )){
    wp_list_categories(array(
      'show_option_all' => '', 'title_li' => '', 'separator' => '%20', 'orderby' => 'name'
    )); 
  } else {
    the_terms($posts->ID, 'jetpack-portfolio-type'); 
  }      
?>

因此, 如果这些页面-显示此页面, 否则显示此页面。我知道$ post-ID是归档页面的下落位置。不知道为什么博客位不起作用。

希望足够继续。我向你无限的知识蜂巢致敬!


#1


根据你创建的自定义模板, 你将需要使用get_footer函数调用自定义页脚。在这里, 你可以阅读有关get_footer函数的更多信息。你只需要指定$ name参数。

莫妮卡

来源:

https://www.srcmini02.com/63221.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_37670.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?