###前提・実現したいこと
WordPressのプラグイン「WP Browsing History」を使って、ユーザーが商品ページや、ニュースページ、固定ページなどアクセスした際に、閲覧履歴を表示させたいです。
また、閲覧履歴にアクセスしたページのアドレスと一緒に、商品ページのアイキャッチ画像も取得し、表示させたいです。色々調べましたが、同じような質問が見つからなかったため、質問させていただきました。
###発生している問題・エラーメッセージ
現状で閲覧履歴の表示、一部ページのみ反映はされている。
固定ページ、商品ページは、時間取得は反映されるが、タイトルがundefinedとなり、URLもhttp://www.example/undefinedとなってしまう。
###参考サイト:下記サイトのまま入力・修正等行っています。
http://did2memo.net/2014/08/19/wp-browsing-history/#i-7
###閲覧履歴を表示するためのコード
<?php if ( function_exists( 'wp_browsing_history_list' ) ) wp_browsing_history_list(); ?>
###CSS
<div class="wp-browsing-history"> <h2 class="history-header">閲覧履歴</h2> <ol class="history-list"> <li class="history-record history-record-1"> <span class="history-title"> <a href="http://..../" class="history-link"> 記事タイトル </a> </span> <span class="history-date"> (2014/01/01 00:00:00) </span> </li> <li class="history-record history-record-2"> ... </li> ... <li class="history-record history-record-5"> ... </li> </ol> </div>
###設定
const WPBH_COOKIE_NAME_HISTORY = "browsing_history"; const WPBH_COOKIE_VERSION = "1.0.0"; const WPBH_MAX_HISTORY_LENGTH = 5; const WPBH_ENABLE_HEADING = true; const WPBH_HEADING_TEXT = "閲覧履歴" const WPBH_ENABLE_DATE = true; const WPBH_ENABLE_DATE_BR = true;
回答1件
あなたの回答
tips
プレビュー