• Resolved sachsongngu

    (@sachsongngu)


    Hi,

    First of all, I would like to say your plugin is awesome compare to other. I love it very much.

    But I just have a minor issue that I want to change the word “Related Articles” to “Index”. My site is using English language as default. Could you please guide where I can change this word?

    Thank you very much.

    • This topic was modified 5 years, 1 month ago by sachsongngu.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author BasePress

    (@codesavory)

    Hi @sachsongngu,

    I am happy you like BasePress!

    To change the widget text you can visit WordPress menu Appearance > Widgets then open the Knowledge Base Sidebar. There you will see a widget for Related Articles. You can change the title from there.
    You can also find more widgets to use in your Knowledge Base.

    Thanks

    Thread Starter sachsongngu

    (@sachsongngu)

    And one more question is how to add KB section to the post title? Thank you very much.

    • This reply was modified 5 years, 1 month ago by sachsongngu.
    Plugin Author BasePress

    (@codesavory)

    Hi @sachsongngu,

    Can you please tell me if you mean the post title in the widget or the post title when viewing an articles page?

    Thanks

    Thread Starter sachsongngu

    (@sachsongngu)

    Hi @codesavory

    Thank you very much for your quick reply.

    It is the post title. Please refer to below screenshot.

    https://gaubaccuc.ucoz.com/_ld/1/119_title_with_KB.jpg

    The title in attached photo is the post title + site name. I would like to add the category between them.

    Example: post title + category title + site name ==> Chapter 1. Introduction – The first and last freedom – Sách Song Ng?

    Thank you again.

    Plugin Author BasePress

    (@codesavory)

    Hi @sachsongngu,

    Thanks for clarifying!
    You can change the title as you need by adding the following code to your theme’s functions.php:

    function set_kb_articles_titles( $parts ){
    	global $post;
    
    	if( is_singular( 'knowledgebase') ){
    		$section = get_the_terms( $post, 'knowledgebase_cat' );
    		if( ! empty( $section ) && ! is_wp_error( $section ) ){
    			if( isset( $section[0]->name ) ){
    				$parts['title'] .= ' ' . $section[0]->name;
    			}
    		}
    	}
    	return $parts;
    }
    add_filter( 'document_title_parts', 'set_kb_articles_titles' );

    Thanks

    Thread Starter sachsongngu

    (@sachsongngu)

    Hi,

    Thank you. But I already the code and nothing changed. Could you please help check again? Thank you very much.

    Please refer to below screenshot.

    https://gaubaccuc.ucoz.com/_ld/1/122_newlyupdate.jpg
    https://gaubaccuc.ucoz.com/_ld/1/121_themefunction.jpg

    Thanks for your time.

    Plugin Author BasePress

    (@codesavory)

    Hi @sachsongngu,

    that error happens because that the same code has been added to two files.

    Please remove it from:

    wp-content/plugins/basepress/themes/modern/functions.php:124

    and just add it to:

    wp-content/themes/journalist-feedly/functions.php

    That should do it.

    Thread Starter sachsongngu

    (@sachsongngu)

    I know you already replied but I can’t see it until it is approved. LOL ~~

    Plugin Author BasePress

    (@codesavory)

    Hi,

    can you please tell me if you are using any other plugin that may also set the post title? Like a SEO plugin for example? If you are using a SEO plugin that could already be done from that plugin and avoid the extra code.

    Also does that article have a sectioned assigned already? If the article has no section the code would not change the title.

    Thanks

    Thread Starter sachsongngu

    (@sachsongngu)

    Hi,

    1. I am using Yoast SEO plugin and I also set up it to have category title but it did not appear so I came to you for help.

    2. I did add the section for all of them.

    Thanks for your help and time.

    Plugin Author BasePress

    (@codesavory)

    Hi,

    I have tested Yoast SEO and I can confirm that it does override what the code does.
    That said you can use Yoast SEO Title without issues. In the title field for the article just type %knowledgebase_cat%. That will do what you need without using the extra code.

    To use Yoast for your KB archive pages:
    Visit Knowledge Base > Manage KBs and click in the edit icon that appears when hovering the KB. In the edit panel that opens scroll to the bottom and click on “View more”. From there you can set the SEO fields for the KB.

    For the sections do the same but from Knowledge Base > Sections.

    Thanks

    Thread Starter sachsongngu

    (@sachsongngu)

    Hi,

    thank for your time and effort. I’m not sure where Im wrong but it does not work.

    KB setting To use Yoast: https://gaubaccuc.ucoz.com/img/1.jpg
    Yoast SEO Title: https://gaubaccuc.ucoz.com/img/2.jpg
    (even I use all Yoast SEO provided titles but it still did not appear)
    Result: https://gaubaccuc.ucoz.com/img/3.jpg

    ??

    • This reply was modified 5 years, 1 month ago by sachsongngu.
    Plugin Author BasePress

    (@codesavory)

    Hi,

    That seems to be an issue with Yoast SEO.

    Please try this:
    1. Go to the edit screen for your article.
    2. Scroll down to Yoast SEO fields
    3. In Snippet Preview click on Edit snippet
    4. In the SEO Title add %knowledgebase_cat%

    You will notice that as soon as you start typing it will suggest the taxonomy for you to choose. This works in the frontend just fine.

    If you do it from Yoast Search Appearance it doesn’t even suggests the taxonomy and it doesn’t work in the frontend.
    I am not able to tell you why it wouldn’t work from there but The Yoast team should be able to help with this.

    Thanks

    Thread Starter sachsongngu

    (@sachsongngu)

    Hi @codesavory ,

    I saw it and it is workable in the article. Thank you very much for your support and kindness. Thank you again.??????

    Thread Starter sachsongngu

    (@sachsongngu)

    Hi,

    Just want to let you know I have figured it out by copying the snippet from article to SEO setting page. In there it is ct_knowledgebase_cat. ?? and working for all articles. ??

    Thank you very much again ^^!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘How to change default text’ is closed to new replies.