Forum Replies Created

Viewing 12 replies - 46 through 57 (of 57 total)
  • Thread Starter kazskater99

    (@kazskater99)

    here are all code i am checking too

    i changed to Twenty Twenty one or what ever Twenty still error massage shown.

    i deactived all plugin but still error message too.

    Thread Starter kazskater99

    (@kazskater99)

    // テーマの機能をサポート
    /** カスタムメニュー機能を有効にするコード(CHAPTER 12)*/
    add_theme_support( 'menus' );
    
    add_theme_support('wp-block-styles');
    add_theme_support('responsive-embeds');
    add_theme_support('align-wide');
    
    // ブロックエディタ用スタイル機能を追加
    add_action('after_setup_theme', function () {
        add_theme_support('editor-styles');
        // ブロックエディタ用CSSの読み込み
        add_editor_style('css/editor-style.css');  // テーマディレクトリからの相対パス
    });
    
    // 管理画面用のスタイルを読み込む
    add_action('admin_enqueue_scripts', function ($hook_suffix) {
        $admin_style_path = get_template_directory() . "/css/admin-style.css";
        $admin_style_uri = get_template_directory_uri() . "/css/admin-style.css";
        $admin_style_version = file_exists($admin_style_path) ? filemtime($admin_style_path) : null;
    
        // CSSファイルの読み込み
        wp_enqueue_style("admin-style", $admin_style_uri, array(), $admin_style_version);
    });
    
    // ブロックエディタに対してカスタムなCSSを適用
    add_action('enqueue_block_editor_assets', function () {
        $editor_style_path = get_template_directory() . "/css/editor-style.css";
        $editor_style_uri = get_template_directory_uri() . "/css/editor-style.css";
        $editor_script_path = get_template_directory() . "/js/editor-style.js";
        $editor_script_uri = get_template_directory_uri() . "/js/editor-style.js";
    
        // ファイルの最終更新日時を取得
        $editor_style_version = file_exists($editor_style_path) ? filemtime($editor_style_path) : null;
        $editor_script_version = file_exists($editor_script_path) ? filemtime($editor_script_path) : null;
    
        // CSSファイルの読み込み
        wp_enqueue_style("editor-style", $editor_style_uri, array(), $editor_style_version);
    
        // JSファイルの読み込み
        wp_enqueue_script('editor-script', $editor_script_uri, array('wp-blocks'), $editor_script_version, true);
    });
    
    
    // その他の設定
    add_theme_support('post-thumbnails'); // アイキャッチ画像のサポート
    add_image_size('thumb640', 640, 400, true); // カスタムサムネイルの追加
    
    // バックグラウンド設定
    $defaults = array(
        'default-color'          => '',
        'default-image'          => '',
        'default-repeat'         => '',
        'default-position-x'     => '',
        'default-attachment'     => '',
        'wp-head-callback'       => '_custom_background_cb',
        'admin-head-callback'    => '',
        'admin-preview-callback' => ''
    );
    add_theme_support('custom-background', $defaults); // カスタム背景のサポート
    
    // 検索時の固定ページの除外
    function my_posy_search($search) {
        if (is_search()) {
            $search .= " AND post_type = 'post'";
        }
        return $search;
    }
    add_filter('posts_search', 'my_posy_search'); // 検索時に固定ページを除外
    
    // SVGアップロードのサポート
    function add_svg_upload($file_types) {
        $add_filetypes = array('svg' => 'image/svg+xml');
        $file_types = array_merge($file_types, $add_filetypes);
        return $file_types;
    }
    add_action('upload_mimes', 'add_svg_upload'); // SVGのアップロードサポート
    
    // 抜粋の文字数の設定
    function twpp_change_excerpt_length($length) {
        return (wp_is_mobile()) ? 30 : 150; // モバイルとデスクトップで異なる文字数の抜粋
    }
    add_filter('excerpt_length', 'twpp_change_excerpt_length', 999);
    
    // メニューのサポート
    add_theme_support('menus'); // メニューサポート
    register_nav_menu('Bootstrap-Naviwalker', 'global-navigation'); // ナビゲーションメニューの登録
    
    // 抜粋の表示
    function dess_get_excerpt($num_chars) {
        $temp_str = substr(strip_shortcodes(strip_tags(get_the_content())), 0, $num_chars);
        $temp_parts = explode(" ", $temp_str);
        $temp_parts[(count($temp_parts) - 1)] = '';
    
        if (strlen(strip_tags(get_the_content())) > 125) {
            return implode(" ", $temp_parts) . '...';
        } else {
            return implode(" ", $temp_parts);
        }
    }
    
    /* 投稿一覧管理画面にカスタムカラムを追加 */
    function add_posts_columns($columns) {
        $columns['thumbnail'] = 'サムネイル';
        $columns['postid'] = 'ID';
        $columns['count'] = '文字数';
    
        return $columns;
    }
    
    // 投稿一覧管理画面にサムネイル、ID、文字数を表示
    function add_posts_columns_row($column_name, $post_id) {
        if ( 'thumbnail' == $column_name ) {
            $thumb = get_the_post_thumbnail($post_id, array(100,100), 'thumbnail');
            echo ( $thumb ) ? $thumb : '-';
        } elseif ( 'postid' == $column_name ) {
            echo $post_id;
        } elseif ( 'count' == $column_name ) {
            $count = mb_strlen(strip_tags(get_post_field('post_content', $post_id)));
            echo $count;
        }
    }
    
    add_filter( 'manage_posts_columns', 'add_posts_columns' );
    add_action( 'manage_posts_custom_column', 'add_posts_columns_row', 10, 2 );
    
    // 固定ページ一覧画面にサムネイル表示
    function add_page_columns($columns) {
        $columns['thumbnail'] = 'サムネイル';
        return $columns;
    }
    
    function add_page_column_row($column_name, $post_id) {
        if ( 'thumbnail' == $column_name ) {
            $thumb = get_the_post_thumbnail($post_id, array(100,100), 'thumbnail');
            echo ( $thumb ) ? $thumb : '-';
        }
    }
    
    add_filter( 'manage_pages_columns', 'add_page_columns');
    add_action( 'manage_pages_custom_column', 'add_page_column_row', 10, 2);
    
    /* 固定ページ一覧にスラッグを追加する */
    function add_page_column_slug_title( $columns ) {
        $columns[ 'slug' ] = "スラッグ";
        return $columns;
    }
    
    function add_page_column_slug( $column_name, $post_id ) {
        if( $column_name == 'slug' ) {
            $post = get_post( $post_id );
            $slug = $post->post_name;
            echo esc_attr( $slug );
        }
    }
    
    add_filter( 'manage_pages_columns', 'add_page_column_slug_title' );
    add_action( 'manage_pages_custom_column', 'add_page_column_slug', 10, 2 );
    
    // 固定ページ一覧にページIDを追加
    function add_page_id_column($columns) {
        $columns['page_id'] = 'Page ID';
        return $columns;
    }
    
    function display_page_id_column($column, $post_id) {
        if ($column === 'page_id') {
            echo $post_id;
        }
    }
    
    add_filter('manage_pages_columns', 'add_page_id_column');
    add_action('manage_pages_custom_column', 'display_page_id_column', 10, 2);
    
    /** メインカラムの幅を指定 */
    if ( ! isset( $content_width ) ) $content_width = 600;
    
    /** <head>内に RSSフィードのリンクを表示 */
    add_theme_support( 'automatic-feed-links' );
    
    /** サイドバーを定義 */
    register_sidebar( array(
        'name'      => 'サイドバーウィジット-1',
        'id'      => 'sidebar-1',
        'description' => 'サイドバーのウィジットエリアです。デフォルトのサイドバーと丸ごと入れ替えたいときに使ってください。',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'  => '</div>',
    ) );
    
    register_sidebar( array(
        'name'      => 'サイドバーウィジット-2',
        'id'      => 'sidebar-2',
        'description' => 'サイドバーのウィジットのテストです。',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'  => '</div>',
    ));
    
    // HTML5 Blank navigation
    function html5blank_nav()
    {
        wp_nav_menu(
            array(
                'theme_location'  => 'side-menu',     
                'menu'            => 'side-menu',          
                'container'       => 'div',
                'container_class' => 'menu-{menu slug}-container',
                'container_id'    => '',
                'menu_class'      => 'menu',
                'menu_id'         => '',
                'echo'            => true,
                'fallback_cb'     => 'wp_page_menu',
                'before'          => '',
                'after'           => '',
                'link_before'     => '',
                'link_after'      => '',
                'items_wrap'      => '<ul>%3$s</ul>',
                'depth'           => '1. dropdown menu use',
            )
        );
    }
    
    // Register HTML5 Blank Navigation
    function register_html5_menu()
    {
        register_nav_menus(array(
            'header-menu' => __('Header Menu', 'html5blank'),
        ));
    }
    
    
    //下記が参考リフェレンス
    
    /*
    <?php wp_nav_menu(
        array(
          'menu'            => '',  //管理画面でつけたメニューの名前 
    
          'menu_id'         => '{メニューのスラッグ}-{連番}', //メインのulタグにつけるid名
    
          'menu_class'      => 'menu', //メインのulタグにつけるクラス名
    
          'container'       => 'div', // メニューを何のタグで囲むか div nav false が利用できる。falseなら囲まない
    
          'container_id'    => '',  //containerのid名
    
          'container_class' => 'menu-{メニューのスラッグ}-container', // containerのクラス名
    
          'fallback_cb'     => 'wp_page_menu', // メニューが存在しない場合に呼び出す関数
    
          'before'          => '', // リンクテキストの前に表示するテキスト
    
          'after'           => '', // リンクテキストの後に表示するテキスト
    
          'link_before'     => '', // リンクの前に表示するテキスト
    
          'link_after'      => '', // リンクの後に表示するテキスト
    
          'echo'            => true, // true: HTML出力  false:phpで返す 
    
          'depth'           => 0, // 何階層まで表示するか。0を指定すると全階層
    
          'walker'          => '', // 適用するカスタムウォーカーを指定
    
          'theme_location'  => '', // テーマの中で使われる位置。あらかじめ register_nav_menu() で登録しておく 
    
          'items_wrap'      => '<ul id="%1$s" class="%2$s">%3$s</ul>', //出力形式。 %1$s に 'menu_id'の値 、 %2$s に 'menu_class'の値 、%3$sにメニュー項目が展開される。%3$sは省略不可
    
          )
      );
      ?>*/
    
    
    
    /** 抜粋の[...]を...に変更するコード(CHAPTER 14)*/
    function new_excerpt_more( $more ) {
      return ' ... ';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );
    
    
    //一つのアクションフックからファイルを読み込む方法
    /*function my_styles() {
      wp_enqueue_style('my-style', get_theme_file_uri('/style.css'));
    }
    add_action( 'wp_enqueue_scripts', 'my_styles' );
    */
    
    
    // Google Fonts
    //function add_google_fonts() {
        //wp_enqueue_style('google_fonts_open_sans', 'https://fonts.googleapis.com/css2?family=Inter:wght@100;400&display=swap', array(), null);
    //}
    
    //add_action('wp_enqueue_scripts', 'add_google_fonts');
    
    // Awesome Fonts
    function add_awesome_fonts() {
        wp_enqueue_script('awesome_fonts', 'https://kit.fontawesome.com/653858111e.js');
    }
    
    add_action('wp_enqueue_scripts', 'add_awesome_fonts');
    
    // CSSキャッシュ更新
    function themebs_enqueue_styles() {
        $version = filemtime(get_template_directory() . '/style.css');
    
        wp_enqueue_style('bootstrap_css', get_template_directory_uri() . '/css/bootstrap.css', array(), $version);
        wp_enqueue_style('bootstrap_custom', get_template_directory_uri() . '/css/bootstrap.custom.css', array(), $version);
        wp_enqueue_style('editor_style', get_template_directory_uri() . '/css/editor-style.css', array(), $version);
        wp_enqueue_style('lite-yt-embed', get_template_directory_uri() . '/css/lite-yt-embed.css', array(), $version);
        wp_enqueue_style('lite-vimeo-embed', get_template_directory_uri() . '/css/lite-vimeo-embed.css', array(), $version);
        wp_enqueue_style('style', get_stylesheet_uri(), array(), $version);
        wp_enqueue_style('swiper-style', get_template_directory_uri() . '/css/swiper-bundle.css', array(), $version);
        wp_enqueue_style('slicknav-custom', get_template_directory_uri() . '/css/slicknav.css', array(), $version);
        wp_enqueue_style('slick-slider', get_template_directory_uri() . '/css/slick.css', array(), $version);
        wp_enqueue_style('admin-style', get_template_directory_uri() . '/css/admin-style.css', array(), $version);
        wp_enqueue_style('lightbox_css', get_template_directory_uri() . '/css/lightbox.css', array(), $version);
    }
    
    add_action('wp_enqueue_scripts', 'themebs_enqueue_styles');
    
    function themebs_enqueue_scripts() {
        $version = filemtime(get_template_directory() . '/js/scripts.js');
    
        wp_enqueue_script('jquery-migrate', get_template_directory_uri() . '/js/jquery-migrate-3.3.2.js', array('jquery'), '3.3.2', true);
        wp_enqueue_script('bootstrap_min', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), $version);
        wp_enqueue_script('swiper-slider', get_template_directory_uri() . '/js/swiper-bundle.min.js', array('jquery'), $version);
        wp_enqueue_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), $version);
        wp_enqueue_script('slick-slider', get_template_directory_uri() . '/js/slick.min.js', array('jquery'), $version);
        wp_enqueue_script('isotope', get_template_directory_uri() . '/js/isotope.pkgd.min.js', array('jquery'), $version);
        wp_enqueue_script('dotdot', get_template_directory_uri() . '/js/jquery.dotdotdot.min.js', array('jquery'), $version);
        wp_enqueue_script('imagesloaded', get_template_directory_uri() . '/js/imagesloaded.pkgd.min.js', array('jquery'), $version);
        wp_enqueue_script('js-script', get_template_directory_uri() . '/js/scripts.js', array('jquery'), $version);
        wp_enqueue_script('lite-yt-embed', get_template_directory_uri() . '/js/lite-yt-embed.js', array('jquery'), $version);
        wp_enqueue_script('lite-vimeo-embed', get_template_directory_uri() . '/js/lite-vimeo-embed.js', array('jquery'), $version);
        wp_enqueue_script('lightbox_min_js', get_template_directory_uri() . '/js/lightbox.min.js', array('jquery'), $version);
    
        // wp-editorを削除する
        wp_deregister_script('wp-editor');
    }
    
    add_action('wp_enqueue_scripts', 'themebs_enqueue_scripts');
    
    // 特定のID 9517 single.php 読み込んでlightboxを表示
    // カスタムフィールドで読み込んでいる画像にlightboxで表示させている。
    function enqueue_custom_lightbox_script() {
        if (is_single() && get_the_ID() == 9517) {
            $script_version = filemtime(get_template_directory() . '/js/scripts.js');
            wp_enqueue_script('custom-lightbox', get_template_directory_uri() . '/js/scripts.js', array('jquery', 'lightbox_min_js'), $script_version, true);
        }
    }
    
    add_action('wp_enqueue_scripts', 'enqueue_custom_lightbox_script');
    
    Thread Starter kazskater99

    (@kazskater99)

    no i am developer

    Notice: Function wp_enqueue_script() was called incorrectly. “wp-editor” script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031

    not sure this error i find

    Thread Starter kazskater99

    (@kazskater99)

    placefolder works thanks.

    Table Press Premium which cost.. not sure right now thank you 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

    Thread Starter kazskater99

    (@kazskater99)

    Notice: Function is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031

    Notice: Function is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031

    Recovery Mode not initialized. what is mean? another error i saw

    Thread Starter kazskater99

    (@kazskater99)

    Thanks for replying me back. i changed theme TwentyTwentyFour no error message shown.

    nothing to do with plug in.

    how do i know check old php code to fix? check all page?

    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..

    Thread Starter kazskater99

    (@kazskater99)

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

    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)

    ok i solved the issue thanks

    Thread Starter kazskater99

    (@kazskater99)

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

    my post page show up.

Viewing 12 replies - 46 through 57 (of 57 total)