【问题标题】:Wordpress force the_content() to return complete when using WooCommerce Memberships使用 WooCommerce 会员资格时,Wordpress 强制 the_content() 返回完成
【发布时间】:2019-03-15 01:35:25
【问题描述】:

我正在使用 WooCommerce Memberships 插件来限制我网站上的帖子访问,这似乎将 the_content() 限制为仅显示前 55 个单词 (the_excerpt())。其后的任何内容都被 Membership 插件隐藏,这是预期的行为。

但是,我正在寻找一种以编程方式绕过此限制并强制 the_content() 或其他函数始终返回完整帖子内​​容的方法。

有没有办法做到这一点?

【问题讨论】:

    标签: php wordpress woocommerce woocommerce-memberships


    【解决方案1】:

    您是否尝试过 get_the_content() 函数,如果插件对 the_content() 应用了限制,这应该可以工作。

     <?php get_the_content();?>
    

    【讨论】:

    • 是的,不幸的是,它返回了相同的 the_content() 缩短版本。
    • 检查全局对象 $post 它显示的内容我确信 $post->post_content 将显示完整的内容。
    • 不幸的是同样的情况,$post->post_content 返回相同的缩短版本。
    猜你喜欢
    • 2017-10-24
    • 2022-08-22
    • 2018-12-20
    • 1970-01-01
    • 2014-05-15
    • 1970-01-01
    • 2023-03-19
    • 2012-06-21
    • 1970-01-01
    相关资源
    最近更新 更多