Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter kazskater99

    (@kazskater99)

    table press does not show up any more in my custome post page.

    my post page show up.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi!

    Thanks for your post and sorry for the trouble!

    It looks like you are using the get_the_content() template tag function (wrapped in wp_kses_post()). This will not work, because Shortcodes are only evaluated when WordPress runs the the_content filter hook, which is called in the the_content() template tag function.

    So, if you replace

    echo wp_kses_post(get_the_content());

    with

    the_content();

    the TablePress Shortcodes (and Shortcodes from other plugins) should work fine.

    Regards,
    Tobias

    Thread Starter kazskater99

    (@kazskater99)

    ok i solved the issue thanks

    Thread Starter kazskater99

    (@kazskater99)

    i am not sure how to use tablepress javascript for pager in this page..

    <?php
    /*
     * Template Name: Genshin Update News
     * Template Post Type: genshin_updated
     *WordPressでは、新しい投稿タイプやタクソノミーを追加した際には、パーマリンクの再構築 設定の管理画面でパーマリンクをpost名でボタンを押す必要なことがあります。
     */
    ?>
    
    <?php
    //error_reporting(E_ALL);
    //ini_set('display_errors', 1);
    ?>
    
    <?php get_header(); ?>
    
       <!-- ぱんくずリストの追加 -->
            <div id="breadcrumbs">
                <?php breadcrumb2(); //カスタム投稿用のパンクズ読み込み?> 
            </div>
    
    <div id="main">
        <?php if ( have_posts() ) : /** WordPress ループ(メインループ) */
            while ( have_posts() ) : the_post(); /** 繰り返し処理開始 */ ?>
    
            <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                <h6><a href="<?php the_permalink(); ?>" class=""><?php the_title(); //Bootstrap色?></a></h6>
                <p class="post-meta">
    
                    <svg class="icon icon-clock">
                        <use xlink:href="#icon-clock">
                            <span class="post-date"><?php the_time( get_option( 'date_format' ) ); ?></span>
                        </use>
                    </svg>
    
                    <svg class="icon icon-price-tags">
                        <use xlink:href="#icon-price-tags">
                            <span class="category"><!--Category-->
                                    <?php
                                    $terms_new_character = get_the_term_list($post->ID, 'new-character', '', ', ', '');
                                    $terms_news = get_the_term_list($post->ID, 'news', '', ', ', '');
    
                                    echo $terms_new_character;
                                    
                                    if ($terms_new_character && $terms_news) {
                                        echo ', ';
                                    }
    
                                    echo $terms_news;
                                    ?>
                                </span>
                        </use>
                    </svg>
                    <span class="sidebar-comment-num">
                        <?php comments_popup_link( '<i class="far fa-comments"></i> : 0', '<i class="far fa-comments"></i> : 1', '<i class="far fa-comments"></i> : %' ); ?>
                    </span>
                    <script src="https://apis.google.com/js/platform.js"></script>
    
                    <div class="g-ytsubscribe" data-channelid="UC7bt7kQHhaphJjt3GthBzIA" data-layout="default" data-count="default"></div>
    
                </p>
    
                <?php the_content();//ボロックエディターの記事
    
                    // 商品詳細情報
                    if (get_field('product-photo02') || get_field('product-price') || get_field('product-color') || get_field('product-size')) :
                    ?>
                        <h4>Location Map</h4>
                        <table class="design16">
                            <?php
                            if (get_field('product-photo02')) :
                            ?>
                                <tr>
                                    <th>Map</th>
                                    <td><img src="<?php echo esc_url(get_field('product-photo02')['url']); ?>" style="width: 100%; height: auto;" alt="商品画像"></td>
                                </tr>
                            <?php
                            endif;
                            if (get_field('product-price')) :
                            ?>
                                <tr>
                                    <th>Prise</th>
                                    <td><?php echo number_format(esc_html(get_field('product-price'))); ?>円</td>
                                </tr>
                            <?php
                            endif;
                            if (get_field('product-color')) :
                            ?>
                                <tr>
                                    <th>Artifacts</th>
                                    <td><?php echo esc_html(get_field('product-color')); ?></td>
                                </tr>
                            <?php
                            endif;
                            if (get_field('product-size')) :
                            ?>
                                <tr>
                                    <th>Difficulty</th>
                                    <td><?php echo esc_html(get_field('product-size')); ?></td>
                                </tr>
                            <?php
                            endif;
                            ?>
                        </table>
                    <?php
                    endif;
                    ?>
                    
                    <?php
                    // Lates Gallary
                    if (get_field('gallay-image') || get_field('product-price')) :
                    ?>
                        <h4>Coming Up Banner</h4>
                        <!-- カラムの数を指定 -->
                        <div class="gallary-container">
                            <?php
                            for ($i = 1; $i <= 6; $i++) : //3カラム
                                $image_field = 'gallary-image-0' . $i; // 画像の枚数を6に表示
                                $text_field = 'gallary-text-0' . $i; // テキストの枚数を6に表示
    
                                if (get_field($image_field)) :
                            ?>
                                    <div class="gallary-item">
                                    
                                        <!-- 画像のスタイルを追加 -->
                                        <img src="<?php echo esc_url(get_field($image_field)['url']); ?>" alt="商品画像" style="width: 100%; height: auto;">
                                        <p><?php echo esc_html(get_field($text_field)); ?></p>
                                    </div>
                            <?php
                                endif;
                            endfor;
                            ?>
                        </div>
                    <?php
                    endif;
                    ?>
                <?php
                $args = array(
                    'before'      => '<div class="page-link">',
                    'after'       => '</div>',
                    'link_before' => '<span>',
                    'link_after'  => '</span>',
                );
                wp_link_pages( $args ); ?>
                <p class="footer-post-meta">
                    <?php the_tags( 'Tag : ', ', ' ); ?>
                    <span class="post-author">Author<!--作成者--> : <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a></span>
                </p>
            </div>
    
    
             <!-- おすすめ記事一覧の表示 -->
    <?php
    if (get_field('recommend')) :
        $posts = get_field('recommend');
        if ($posts) :
    ?>
            <h4>Genshin Impact weapons&Artifacts</h4>
            <div class="post-wrapper">
                <?php foreach ($posts as $post) : setup_postdata($post); ?>
                    <div class="post-list">
                        <a href="<?php echo esc_url(get_permalink($post->ID)); ?>">
                            <?php
                            $thumbnail_url = esc_url(wp_get_attachment_url(get_post_thumbnail_id($post->ID)));
                            $thumbnail = get_the_post_thumbnail($post->ID, 'thumbnail_size', array('class' => 'img-fluid')); // 'thumbnail_size' を画像サイズの識別子に変更
                            ?>
                            <?php echo $thumbnail; ?>
                            <?php echo esc_html(get_the_title($post->ID)); ?>
                        </a>
                    </div>
                <?php endforeach;
                wp_reset_postdata(); ?>
            </div>
    <?php endif;
    endif; ?>
    
            <!--new pager-->
            <?php //require get_template_directory().'/pager.php';?>
            <!--end new pager-->
    
            <?php
            /**
             * ここから関連記事の表示
             */
    
            if( get_the_terms( $post->ID, 'genshin_updated' ) ) : // カスタムタクソノミー名
    
                $terms = get_the_terms( $post->ID, 'genshin_updated' ); // タクソノミーのタームを取得
                $term_slugs = wp_list_pluck( $terms, 'slug' ); // タームのスラッグを取得
    
                $args = array(
                    'post_type'         => 'genshin_updated',
                    'post__not_in'      => array( $post->ID ),
                    'orderby'           => 'rand',
                    'posts_per_page'    => 6,
                    'tax_query'         => array(
                        'relation'      => 'OR',
                        array(
                            'taxonomy'  => 'new_character',// カスタムタクソノミーのスラッグ. function.php でカスタムタクソノミーの登録 genshin_build_category
                            'field'     => 'slug',
                            'terms'     => get_my_terms_array( 'new_character' ), //タームのスラッグurl genshin_build_category
                            ),
                        array(
                            'taxonomy'  => 'news', // カスタムタクソノミーのスラッグ. function.php でカスタムタクソノミーの登録 genshin_build_category
                            'field'     => 'slug',
                            'terms'     => get_my_terms_array( 'news' ),//タームのスラッグurl genshin_build_category
                        )
                    )
                );
                $related = new WP_Query( $args );
                ?>
                <div class="related-posts">
                    <h2 class="side-title">Related Post</h2>
                    <?php /** サブループ開始 */
                    if ( $related->have_posts() ) : ?>
                        <ul id="related-posts">
                            <?php while ( $related->have_posts() ) : $related->the_post(); ?>
                                <li class="clearfix">
                                    <div class="content-box">
                                        <a href="<?php the_permalink(); ?>" class="badge badge-primary"><?php the_title(); //Bootstrap色 Bootstrap見出しを大きくh4?></a>
                                        <p class="post-meta">
                                            <svg class="icon icon-clock">
                                                <use xlink:href="#icon-clock">
                                                    <span class="post-date"><a href="<?php the_permalink(); ?>"><?php the_time(get_option('date_format')); ?></a></span>
                                                </use>
                                            </svg>
                                            <svg class="icon icon-price-tags">
                                                <use xlink:href="#icon-price-tags">
                                                   <span class="category"><!--Category-->
                                    <?php
                                    $terms_new_character = get_the_term_list($post->ID, 'new-character', '', ', ', '');
                                    $terms_news = get_the_term_list($post->ID, 'news', '', ', ', '');
    
                                    echo $terms_new_character;
                                    
                                    if ($terms_new_character && $terms_news) {
                                        echo ', ';
                                    }
    
                                    echo $terms_news;
                                    ?>
                                </span>
                                                </use>
                                            </svg>
                                            <span class="sidebar-comment-num">
                                                <?php comments_popup_link( '<i class="far fa-comments"></i> : 0', '<i class="far fa-comments"></i> : 1', '<i class="far fa-comments"></i> : %' ); ?>
                                            </span>
                                        </p>
                                        <?php echo dess_get_excerpt(260); ?>
                                        <p class="more-link">
                                            <a href="<?php the_permalink(); ?>" title="「<?php the_title(); ?>」Read"><span class="badge badge-success">Read &raquo;</span></a>
                                        </p>
                                    </div>
                                    <div class="blog-thumbnail-box">
                                        <a href="<?php the_permalink(); ?>" title="「<?php the_title(); ?>」Read">
                                              <?php 
                                                  $days = 14;  // マークを表示する日数よりNEWが表示
                                                  $now = date_i18n('U');  // 今の時間
                                                  $entry = get_the_time('U');  // 投稿日の時間
                                                  $term = date('U',($now - $entry)) / 86400;
                                                  if( $days > $term ){
                                                      echo '<div class="box">';
                                                      echo '<div class="ribbon ribbon-top-left">';
                                                      echo '<span>New</span>';
                                                      echo '</div>';
                                                      echo '</div>'; 
                                                  }
                                              ?>
    
                                              <?php 
                                             if( has_post_thumbnail() ) :
                                                $blog_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array(600,600) ); 
                                                $noimage = get_template_directory_uri() . '/images/noimage.gif';
                                              echo '<div class="blog-post-image" style="background-image:url('.$blog_thumbnail[0].')"></a>';
                                              echo '<h3><a href="'.get_the_permalink().'">'.get_the_title().'</a></h3>';
                                              echo '</div>';;
                                            endif;
                                            ?>
                                        </a>
                                    </div>
                                </li>
                            <?php endwhile; ?>
                        </ul>
                    <?php else : ?>
                        <p>関連する記事はありませんでした ...</p>
                    <?php endif; ?>
                </div><!-- /related-posts -->
                <?php wp_reset_postdata(); /** サブループここまで */
            endif;
            comments_template(); /** コメント欄の表示(CHAPTER 19) */
            endwhile; /** メインループの繰り返し処理ここまで */
        else :  ?>
            <div class="post">
                <h2>記事はありません</h2>
                <p>お探しの記事は見つかりませんでした。</p>
            </div>
        <?php endif; /** メインループここまで */?>
    </div><!-- /main -->
    
    <?php
    // tekken genshin ブログ記事別?カテゴリー でサイドバー表示 分岐
    ?>
    <div id="single">
        <?php
        if (is_singular('genshin_updated')) : // カスタム投稿の投稿記事ページで条件分岐する場合
            get_template_part('sidebar-genshin');
        elseif (is_tax('tekken7_category', 'tekken7')) : // タクソノミー「tekken7_category」でカテゴリーが「tekken7」の場合
            get_template_part('sidebar-tekken');
        else : // それ以外のページの場合
            get_template_part('sidebar');
        endif;
        ?>
    </div>
    
    
    
    <?php get_footer('home1'); ?>
    
    Thread Starter kazskater99

    (@kazskater99)

    i am not sure how to show placefolder in table press.. its hard..too..

    Thread Starter kazskater99

    (@kazskater99)

    https://gamewidth.net/genshin_updated/song-of-days-past-set-bonuses-new-artifacts/

    in this serch box place folde “GEO” i want to show fixed which mean always shown GEO data in table press.

    i need to know technique..

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sorry, I don’t really understand what you mean.

    Regards,
    Tobias

    Thread Starter kazskater99

    (@kazskater99)

    my 1st question is .

    How to make placefolder in serch box

    my 2nd question is.

    how to show table already sorted in specific word already

    https://gamewidth.net/genshin_updated/song-of-days-past-set-bonuses-new-artifacts/

    in this web page serch box placeholder “hydro” and already shown hydro sroted in this page.This table is ID 60

    help me thank you

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the clarification!

    To add a placeholder, you can add this to the “Custom Commands” text field on the table’s “Edit” screen:

    "language": { "searchPlaceholder": "Search..." }

    For the second question, you probably mean “search” or “filter” and not “sort” for a specific word, like “hydro”, right? This is possible with the Row Filtering and Automatic Filtering feature modules that are part of the TablePress premium versions.

    Best wishes,
    Tobias

    Thread Starter kazskater99

    (@kazskater99)

    placefolder works thanks.

    Table Press Premium which cost.. not sure right now thank you Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    the mentioned features are part of the TablePress Pro license plan. Please see https://tablepress.org/pricing/ for pricing information.

    Best wishes,
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘table press does not work in custome post type’ is closed to new replies.