• 断然的 菲奥托拉

    (@fciotola)


    从摘录功能中排除pdf按钮文本:

    $post_type='post';

    //获取此帖子类型的所有分类
    $taxonomies=get_object_taxonomies(数组('post_type'=>$post_type));

    foreach($taxonomies作为$taxon):

    //获取此分类法中的每个“类别”(术语)以获取相应的帖子
    $terms=get_terms($taxonomy);

    foreach($terms作为$term):?>

    <h2 class=“entry-title”><?php echo$term->name;?></h2>

    <?php(电话)
    $args=阵列(

    'post_type'=>$post_type,
    “posts_per_page”=>-1,//显示所有帖子
    “tax_query”=>数组(
    阵列(
    “taxonomy”=>$taxonomy,
    “字段”=>“slug”,
    “terms”=>$term->slug,
    “猫”=>“-3”
    )
    )

    );
    $posts=新WP_Query($args);

    if($posts->have_posts()):while($posts->have_posts()):$posts->the_post();?>

    <article id=“prodotti”>文章id=“prodotti”>

    <?php if(has_post_thumbnail()){?>
    “title=”<?php echo get_the_title();?>“>
    <?php the_post_thumbnail('archive-custom-size',数组('class'=>'aligncenter'));?>

    <?php}
    /*没有帖子图像,因此显示默认值*/
    其他{?>
    /assets/img/default-img.png“alt=”<?php echo get_the_title();?>“title=“<?php echo get_the_title();?>“width=“110”height=“110”/>
    <?php}?>

    <h3>“title=”<?php echo get_the_title();?>“><?php echo get_the_title();?></h3>

    <?php the_exercert();?>

    </文章><!–关于-box–>

    <?php endwhile;endif;?>结束

    <?php endforeach;

    每个端点;?>

查看7条回复-1条到7条(共7条)
  • 插件作者 迪纳米科

    (@dinamiko)

    你好,fciotola,

    如何添加PDF按钮?
    通过DK PDF设置/PDF按钮/帖子类型应用
    或者在每个帖子中手动添加[dkpdf-button]短代码?

    谢谢。

    螺纹起动器 菲奥托拉

    (@fciotola)

    感谢您的快速回复,我正在通过DK pdf设置添加pdf按钮。

    插件作者 迪纳米科

    (@dinamiko)

    你好,
    我无法重现这个问题,我在_excert中没有看到PDF按钮,只有在更改_excerp的_content时才看到该按钮。

    您可以尝试过滤_excert并删除按钮,如下所示:

    函数custom_excert_filter($excurpt){删除短代码('dkpdf-button');$excrpt=str_replace(“[dkpdf-button]”,“”,$excrpt);return$摘录;}add_filter('get_the_excerpt','custom_excert_filter');

    更多信息请点击此处:https://codex.wordpress.org/Plugin_API/Filter_Reference/get_the_excerpt

    谢谢。

    螺纹起动器 菲奥托拉

    (@fciotola)

    你好,
    您可以在这里看到问题:http://www.sophiahightech.com/sht/attrezzature-di-prova-sui-materiali/

    你如何在这个页面上看到按钮的标签在每个摘录的开头。

    插件作者 迪纳米科

    (@dinamiko)

    你好,fciotola,

    我在你url的摘录中没有看到PDF按钮,所以我想你已经看到了🙂
    我要关闭这张罚单,随时可以重新打开它或创建一张新的。

    谢谢,
    埃米利。

    插件作者 迪纳米科

    (@dinamiko)

    对不起,我现在看到了🙂
    您要做的是将此代码添加到主题函数中。php

    函数custom_excert_filter($excurpt){$excrpt=str_replace(“下载PDF”,“”,$excrpt);return$摘录;}add_filter('get_the_excerpt','custom_excert_filter');

    试试看,告诉我它是否有效。

    谢谢,
    埃米利

    螺纹起动器 菲奥托拉

    (@fciotola)

    谢谢Dinamiko,它很有魅力。

查看7条回复-1条到7条(共7条)
  • 主题“从摘录功能中排除pdf按钮文本”对新回复关闭。