我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如果字幕存在问题

I'm using the newest wordpress.

In my theme, I'm using the following code:

<?php
   if (the_subtitle() == "") {
       echo the_title();
   } else {
       echo the_subtitle();
   } ?>

Each page has a default title. Some pages have a subtitle. If there IS a subtitle, then the title shouldn't be displayed and the subtitle should take it's place.

But right now for some reason, it's displaying the subtitle and THEN the title?

You don't need to call echo. It already echoes.

<?php
   if (the_subtitle("","", false) == "") {
       the_title();
   } else {
       the_subtitle();
   } ?>

近期文章

  • 如何使用php函数在引号内打印字符变量
  • 如何使用jquery自动完成与php获取的服务器/ SQL数据?
  • 由于Vendor文件夹找不到Laravel类?
  • 我可以使用imagemagick从右侧复合吗?
  • 使用DOMDocument获取标题标记值
  • 将日期转换为全长[重复]
  • 使用xdebug在eclipse中运行或调试php应用程序
  • 在AJAX中将JSON数据添加到表中
  • Mysql子查询平均为7天和30天
  • oauth2-server-laravel的问题
  • 更新记录,或者如果用户在处理订单之前编辑其购物车,则删除并重新插入
  • Google+ OAuth API - 错误400
  • 如何使用Htaccess重新排列URL路径
  • ZF2-Form提交没有在模态本身重新加载页面,如图所示
  • AJAX请求成功但返回空数据
  • 发送$ FILE数据以形成输入
  • php不会将值发布到电子邮件中
  • cURL无法从运行Varnish Cache的服务器下载图像文件
  • 从多个数据库查询
  • 在Symfony 2中路由到图像

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华