ringomaru回答ポイント 200ptウォッチ

wordpress popular postsのulのクラスを変えたいのですがstr_replaceの挿入箇所を教えてください。

下記のPHPのどこに
$popular = ob_get_clean();
$popular = str_replace('<ul class="wpp-list">', '<ul class="samecate">', $popular);
を入れたらulのclassを変えられますか?
ネットで調べてみましたが、もともとの書き方が違う例しか見つけられず、どこに記載していいか分かりません。分かる方、宜しくお願いします。

<?php if (function_exists('wpp_get_mostpopular')): ?>
<h3>よく読まれている<?php $cat = get_the_category(); $cat = $cat[0]; $catp = $cat->category_parent ; $catn = get_the_category_by_ID( $catp ); $catl = get_category_link( $catp ); ?><?php echo $catn; ?>情報</h3>
<?php
// オプションの設定
$args = array(
'limit' => 6,
'range' => 'weekly',
'order_by' => 'views',
'post_type' => 'post',
'thumbnail_width' => 80,
'thumbnail_height' => 80,
'title_length' => 40,
'post_html' => "<li>{thumb}{title}</li>"
);

global $_curcat;
if ($_curcat->term_id) {
if ($_curcat->category_parent != 0) {
$_curcat = get_top_category($_curcat->term_id);
}
$catids = get_categories('fields=ids&child_of=' . $_curcat->term_id);
$catids[] = $_curcat->term_id;
$args['cat'] = implode(',', $catids);
}
// 関数の実行
wpp_get_mostpopular($args);
?>

※ 有料アンケート・ポイント付き質問機能は2023年2月28日に終了しました。
ログインして回答する
回答がありません

この質問へのコメント

この質問への反応(ブックマークコメント)

質問の情報

登録日時
2015-09-03 02:10:03
終了日時
2015-09-10 02:15:03
回答条件
1人1回まで

この質問のカテゴリ

この質問に含まれるキーワード

wordpress1195PHP7798関数2326Class541オプション1258

人気の質問

メニュー

PC版