[解決済み] 既存のテーマを利用したショップの作り方(その1)について

フォーラム 使い方全般 [解決済み] 既存のテーマを利用したショップの作り方(その1)について

  • このトピックには2件の返信、2人の参加者があり、最後にketoninfoにより13年、 9ヶ月前に更新されました。
3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • 投稿者
    投稿
  • #49837
    ketoninfo
    参加者

    既存のテーマを利用したショップの作り(その1)を参考に基本設定と配送設定を終わらせて、商品を2つ登録して公開しました。その直後は最新記事なので当然トップページ部分に表示されました。

    現在、Carringtonというテーマをダウンロードして運用してます。

    http://wordpress.org/extend/themes/carrington-blog

    こちらのindex.phpには以下の記述がありませんでした。

    ‘<?php if (have_posts()) : ?>’

    なので、文字検索で探したところ、attachment-default.phpに以下の記述がありました。

    ‘<?php if (have_posts()) : while (have_posts()) : the_post(); ?>’

    近いものでしたので、その直後に以下を書き加えて、上書き保存させてもらいました。

    (商品カテゴリーIDは46)

    しかしブログを更新しても相変わらずトップ画面に商品が表示され続けています。

    大変お手数なのですが、解決策をご教授願えればと思います。どうぞ宜しくお願い致します。

    現在の使用環境は以下となっております。

    Welcart:0.5.2

    サーバー:Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8i PHP/4.4.9

    MySQL:5.0.51b

    PHP:5.2.10

    使用テーマ:carrington Ver2.2

    ブラウザ:Firefoxバージョン3.5.10

    Wordpressバージョン:3.0-ja(今回バージョンアップしましたが変化なし)

    (Welcartのホーム画面より利用環境を書きました)

    【以下attachment-default.phpより近辺を抜粋させて頂きました】

    <?php

    // This file is part of the Carrington Blog Theme for WordPress

    // http://carringtontheme.com

    //

    // Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.

    // http://crowdfavorite.com

    //

    // Released under the GPL license

    // http://www.opensource.org/licenses/gpl-license.php

    //

    // **********************************************************************

    // This program is distributed in the hope that it will be useful, but

    // WITHOUT ANY WARRANTY; without even the implied warranty of

    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    // **********************************************************************

    if (__FILE__ == $_SERVER) { die(); }

    if (CFCT_DEBUG) { cfct_banner(__FILE__); }

    $use_background_img = cfct_get_option(‘cfct_css_background_images’);

    $use_background_img == ‘no’ ? $css_ext = ‘?type=attachment-noimg’ : $css_ext = ‘?type=attachment’;

    global $post;

    ?>

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

    <html xmlns=”http://www.w3.org/1999/xhtml&#8221; <?php language_attributes(); ?>>

    <head profile=”http://gmpg.org/xfn/11″&gt;

    <title><?php wp_title( ‘-‘, true, ‘right’ ); echo wp_specialchars( get_bloginfo(‘name’), 1 ); ?></title>

    <meta http-equiv=”content-type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />

    <link href=”<?php bloginfo(‘url’) ?>” rel=”home” />

    <link rel=”alternate” type=”application/rss+xml” href=”<?php bloginfo(‘rss2_url’) ?>” title=”<?php printf( __( ‘%s latest posts’, ‘carrington’ ), wp_specialchars( get_bloginfo(‘name’), 1 ) ) ?>” />

    <link rel=”alternate” type=”application/rss+xml” href=”<?php bloginfo(‘comments_rss2_url’) ?>” title=”<?php printf( __( ‘%s latest comments’, ‘carrington’ ), wp_specialchars( get_bloginfo(‘name’), 1 ) ) ?>” />

    <link rel=”pingback” href=”<?php bloginfo(‘pingback_url’) ?>” />

    <?php wp_get_archives(‘type=monthly&format=link’); ?>

    <link rel=”stylesheet” type=”text/css” media=”screen” href=”<?php bloginfo(‘template_url’) ?>/css/css.php<?php echo $css_ext; ?>” />

    <?php if ($use_background_img == ‘yes’): ?>

    <!–[if lte IE 6]>

    <script type=”text/javascript” src=”<?php bloginfo(‘template_directory’); ?>/js/DD_belatedPNG.js”></script>

    <script type=”text/javascript”>

    DD_belatedPNG.fix(‘img, #header, #header .wrapper, .figure-info, .previous-attachment, .next-attachment’);

    </script>

    <![endif]–>

    <?php endif; ?>

    <?php wp_head(); ?>

    </head>

    <body id=”attachment”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div id=”header”>

    post_parent); ?>” rev=”up post”>← <?php printf(__(‘back to “%s”’, ‘carrington-blog’), get_the_title($post->post_parent)); ?>

    </div>

    <div id=”attachment-content” class=”figure”>

    <div class=”entry-attachment”>

    ” href=”<?php echo wp_get_attachment_url($post->ID); ?>”><?php echo wp_get_attachment_image( $post->ID, ‘large’ ); ?>

    </div>

    <div class=”figure-info”>

    <div class=”caption”>

    <h1 class=”title”><?php the_title(); ?></h1>

    <?php if ( !empty($post->post_excerpt) ) the_excerpt(); // this is the “caption” ?>

    </div>

    <div class=”description”>

    <?php the_content() ?>

    </div>

    </div>

    <?php

    if(cfct_get_adjacent_image_link(false) != ”) {

    echo ‘<div class=”next-attachment”><span>’,next_image_link(),'</span></div>’;

    }

    if(cfct_get_adjacent_image_link(true) != ”) {

    echo ‘<div class=”previous-attachment”><span>’,previous_image_link(),'</span></div>’;

    }

    ?>

    </div>

    <?php endwhile; else:

    cfct_template_file(‘misc’,’no-results.php’);

    endif; ?>

    <?php wp_footer() ?>

    </body>

    </html>

    #59894
    nanbu
    キーマスター

    こんにちは。

    ブログにおいて、商品を除外して通常の記事のみを表示させるには、管理パネルのWelcart Shop システム設定ページの「表示モード」にチェックを入れ設定を更新してください。

    ただこの機能、今気が付いたのですが、不具合があってちゃんと機能していませんでした。修正してDevelopment Version を更新しましたので、そちらをダウンロードしてご利用ください。

    よろしくお願いします。

    #59895
    ketoninfo
    参加者

    nanbuさん

    回答有難う御座いました。早速、デベロップバージョンを適用させてもらいました。

    ‘<?php if (have_posts()) : while (have_posts()) : the_post(); ?>’の直下に下記の一文を挿入せずに改善されておりました。

    ‘<?php query_posts(“cat=-3”); ?>’

    全てのファイルを検索したのですが、該当しませんでした。

    引き続き「既存のテーマを利用したショップの作り方(商品だけのループページ)」を続けて行きたいと思いますが、デベロップバージョンで手順が変わることはありませんでしょうか?

    ご多忙の中恐縮ですが、とうぞご教授ください。

3件の投稿を表示中 - 1 - 3件目 (全3件中)
  • このトピックに返信するにはログインが必要です。