WordPress.org

Support

Support » Plugins and Hacks » WORDPRESS VIDEO GALLERY » [Resolved] how to show category name on browser title

[Resolved] how to show category name on browser title

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    I have checked your site and found that the category name is displaying as a page title in your site. Please refer http://screencast.com/t/WctrmfSp and check and let us know if you are still facing any difficulties.

    Hi,
    Could you guide me where in your code do that?

    Thanks.

    Hi,

    Please open \wp-content\plugins\contus-video-gallery\hdflvvideoshare.php and add the below code after the code add_action('wp_enqueue_scripts', 'videogallery_cssJs'); and check.

    add_filter( 'wp_title', 'add_category_title', 20 );
    function add_category_title() {
        global $wpdb,$wp_query;
        $playid = filter_input(INPUT_GET, 'playid');
        $videoID = url_to_custompostid(get_permalink());
        if (isset($_GET['p'])) {
            $videoID = intval($_GET['p']);
        }
        $playlist_name = &$wp_query->query_vars["playlist_name"];
        if (!empty($playlist_name)) {
            $playid = get_playlist_id($playlist_name);
        }
        if (!empty($videoID)) {
           return $videoname = $wpdb->get_var("SELECT name FROM " . $wpdb->prefix . "hdflvvideoshare WHERE slug='" . intval($videoID) . "'");
        } else if(!empty($playid)){
            $playlist_name = $wpdb->get_var("SELECT playlist_name FROM " . $wpdb->prefix . "hdflvvideoshare_playlist WHERE pid='" . intval($playid) . "'");
            return $playlist_name;
        }
    }

    If you are still facing any difficulties in this, feel free to contact us.

    Hi,
    I changed the code above. But, when i click on a category. My website show category page with many other categories.
    Please help me fix the bug.

    Thanks

    Hi,

    I have checked your site and the categories are working fine. Please refer http://screencast.com/t/d5zC3UhcOB. Please note that when you click “Video Categories” link, then it will display all the categories with the corresponding videos. But when you click particular category link, then only it will display the exact category videos.

    Hi,
    I fixed it.

    Remove the “&” character before $wp_query->query_vars[“playlist_name”]

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] how to show category name on browser title’ is closed to new replies.
Skip to toolbar