dongshui2254 2019-02-23 09:46
浏览 20

将$ variable打印到HTML表中

I have no knowledge of PHP but I have already been hit so far that I want to put the last bit myself. As you can see below, I retrieve data from the database. Below is the part that it is about.

    <div class="gp-hub-block gp-hub-block-three">

        <?php if ( ghostpool_option( 'hub_fields' ) ) {

            // Support for foreign characters   
            $char_table = array();
            if ( function_exists( 'ghostpool_hub_field_characters' ) ) {
                $char_table = ghostpool_hub_field_characters();
            }   

            foreach( ghostpool_option( 'hub_fields' ) as $gp_hub_field ) {

                $gp_hub_field_slug = strtr( $gp_hub_field, $char_table );
                if ( function_exists( 'iconv' ) ) {
                    $gp_hub_field_slug = iconv( 'UTF-8', 'UTF-8//TRANSLIT//IGNORE', $gp_hub_field_slug );
                }

                $gp_hub_field_slug = sanitize_title( $gp_hub_field_slug );
                $gp_hub_field_slug = substr( $gp_hub_field_slug, 0, 32 );
                $gp_term_list = get_the_term_list( $post_id, $gp_hub_field_slug, '<table class="casino-info"><tbody><span class="aaa"><tr class="casino-info-titel"><th scope="row">' . __($gp_hub_field,'JDcustomnew') . ':</th><td scope="row" data-label="'<?php echo ($gp_hub_field ); ?>'">', ', ', '</td></tbody></table>' );
                if ( ! $gp_term_list OR is_wp_error( $gp_term_list ) ) {
                    continue;
                }   
                if ( ghostpool_option( 'hub_field_links' ) == 'disabled' ) {
                    $gp_term_list = preg_replace( '/<\/?a[^>]*>/', '', $gp_term_list );
                }
                echo wp_kses_post( $gp_term_list );

            }

        } ?>

    </div>  

</div>

You will see below for which part it is exactly

$gp_term_list = get_the_term_list( $post_id, $gp_hub_field_slug, '<table class="casino-info"><tbody><span class="aaa"><tr class="casino-info-titel"><th scope="row">' . __($gp_hub_field,'JDcustomnew') . ':</th><td scope="row" data-label="'<?php echo ($gp_hub_field ); ?>'">', ', ', '</td></tbody></table>' );

What I want to do is return the $gp_hub_field to the datalabel of my table. Unfortunately, I can not do this. Someone who can help me?

Don't blame me for my PHP skills please.

EDIT:

I see this with the PHP code in the data-label: enter image description here

Its important for Google that the data label has the same title as the <TH> I need to see this with the good data-lable title:

enter image description here

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡等级和折扣规则
    • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
    • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
    • ¥15 gdf格式的脑电数据如何处理matlab
    • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
    • ¥100 监控抖音用户作品更新可以微信公众号提醒
    • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
    • ¥70 2048小游戏毕设项目
    • ¥20 mysql架构,按照姓名分表
    • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分