suresh mamidala
asked 7 years ago

Hi
I Santo change the category page title and meta description.
Suppose if click ‘ABC’ category page title shud be ‘ABC questions’
If I click on ‘xyz’ category title Shud be ‘xyz questions’. Plz help to achieve this.
Thanks in advance

2 Answers
Allen
answered 7 years ago

@suresh mamidala: hi , i have a solution for you then, try this πŸ™‚
First , you open file : plugins/dw-question-answer/inc/templates/default/assets/js/dwqa-questions-list.js
go to line 72, see the code category = getURLParameter(dwqa.question_category_rewrite),`
below this line , you add code like this :

category_name = $('.filter-bar #dwqa-filter-by-category li[data-cat="'+$('.filter-bar #dwqa-filter-by-category').data('selected')+'"]').text();

After that , go to line 214, change the code there to :

if (filter_plus != 'all' || category != 'all' || tags != 0 || type != 'all') {
        start_filter();
        document.title = category_name + ' questions';
        $('head').append( '<meta name="description" content="'+category_name+'">' );
    }

Hope this help πŸ™‚

suresh mamidala
answered 7 years ago

i tried as it is but no luck, i dont see any changes in title and in meta description πŸ™

nobita
replied 7 years ago

@suresh : i’ve try it in my site and it work some how. And if you use "Google" to check , it’s quite impossible because This code just active when you load the page . It kinda interface situation, not for google search( google search just crawl the page index and not run javascript ). …At this time, can you send me your site and some information ( admin account or ftp ) via private message ? i’ll try to help you out to make it correctly.

Powered by DW Question & Answer Pro