brelson
Forum Replies Created
Viewing 1 replies (of 1 total)
-
I’ve managed to fix this now. The problem lies with the nr_page_title() function in now-reading.php. I was able to resolve it by looking at the code for Now Watching so credit is due to that plugin’s author.
If you have the same issue, the simplest thing to is to replace nr_page_title() in now-reading.php with the code below:
function nr_page_title( $title ) { global $wp, $wp_query, $wpdb; $wp->parse_request(); $title = ''; if ( get_query_var('now_reading_library') ) $title = 'Library'; if ( get_query_var('now_reading_tag') ) $title = 'Books tagged with “' . htmlentities(get_query_var('now_reading_tag'), ENT_QUOTES, 'UTF-8') . '”'; if ( get_query_var('now_reading_author') ) { $author = $wpdb->escape(urldecode(get_query_var('now_reading_author'))); $author = $wpdb->get_var("SELECT b_author FROM {$wpdb->prefix}now_reading WHERE b_nice_author = '$author'"); $title = 'Books by ' . $author; } if ( get_query_var('now_reading_search') ) $title = 'Library Search'; if ( get_query_var('now_reading_title') ) { $esc_nice_title = $wpdb->escape(urldecode(get_query_var('now_reading_title'))); $book = get_book($wpdb->get_var("SELECT b_id FROM {$wpdb->prefix}now_reading WHERE b_nice_title = '$esc_nice_title'")); $title = $book->title . ' by ' . $book->author; } if ( !empty($title) ) { $title = apply_filters('now_reading_page_title', $title); $separator = apply_filters('now_reading_page_title_separator', ' ? '); return $title.$separator; } return ''; }
Viewing 1 replies (of 1 total)