This topic has 6 replies, 3 voices, and was last updated 6 years by Radu.

  • Author
  • #188452
     HDcms
    Participant

    Hello,

    I want
    a) hide the text before the category at the top of the page

    b) only display the next / previous links in the same category

    I found codes on the internet but these do not work is it to your theme?

    a) https://wordpress.stackexchange.com/questions/175884/how-to-customize-the-archive-title

     

    ‘add_filter(‘get_the_archive_title’, function ($title) {
    return preg_replace(‘/^\w+: /’, ”, $title);
    });’

    b) https://digwp.com/2016/10/wordpress-post-navigation-redux/

    ‘$args = array(
    ‘prev_text’          => ‘Previous post: %title’,
    ‘next_text’          => ‘Next post: %title’,
    ‘in_same_term’       => true,
    ‘taxonomy’           => ‘category’,
    ‘screen_reader_text’ => ‘Post navigation’
    );
    the_post_navigation($args);’

     

    Regards

    #188568
     Laura
    Moderator

    Hello, do you mean the “Archive for” ? You can change it using loco translate:

    Theme strings and plugins strings can easily be changed by using Loco Translate plugin https://wordpress.org/plugins/loco-translate/
    <h3>A small introduction on how translations work</h3>
    Translatable strings can come from the theme or from the installed plugins. You need to translate the theme or the plugin depending on what section of the site your string is found.

    For example if your string is on your BuddyPress profile then most probably you will need to translate BuddyPress plugin. If you are on the Forums section of your site then bbPress plugin should be the one that needs to be translated. Another example is the rtMedia plugin that adds the Media links to BuddyPress and if you want to translate it then this plugin will contain the string.
    <h3>Follow these steps to get you started:</h3>

    • Install Loco Translate plugin
    • Go to the plugin dashboard: WP Admin – Tools – Manage translations
    • Find the theme or plugin in the list.
    • If the language isn’t already in the list then click Add new language, choose your language and if you are asked where you want to save the language files choose global language directory ( wp-content/languages/ ).
    • Press SYNC button to synchronise your translation with the provided .pot file
    • Search for the string you want to translate and add your translated string.
    • Press Save when you finished your translation.

    Note: You will have to set the language for your blog from WP-admin – Settings – General – Site Language – Choose your language

    For b) i do not understand what do you mean

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #188571
     HDcms
    Participant

    Hello,
    yes indeed I had not thought to change the translation (although I would prefer a generic function that does not seem to work!)
    But the problem is that I will have to change every wordpress translation update
    I would have a way to overload the chain (I do it with joomla)

    b) link at the bottom of an article showing a link to the previous article and the next article
    The problem is that it takes into account all the articles of the site.
    I will only want to see links in the same category.
    The solution found does not seem to work

    Regards

    #188691
     Laura
    Moderator

    Hello, no you wont need to do that, when doing a translation, add the language and choose to use CUSTOM or SYSTEM file path so the translation its saved at the system and not at the theme/plugin files ( which could be replace with an update)

    b) i see, i will assign this to @radu to see if he has a solution

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #188777
     Radu
    Moderator

    Hi,

    a. You will need to use this code in your chidl theme functions.php to can overwritte the titles : https://pastebin.com/raw/V25agnBf

    Delete or change the marked words

    TO can have prev next in the same category as displayed post please copy this file : wp-content/themes/kleo/single.php
    to : wp-content/themes/kleo-child/single.php

    around line you will see kleo_post_nav(); change it with kleo_post_nav(‘true’);

    That’s it

    You will have to install and activate kleo child theme.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #188851
     HDcms
    Participant

    Hi,
    I would have preferred an independent solution of the theme (by function) but change the page single.php must work
    Thank you and goo day

    #188873
     Radu
    Moderator

    Hi,

    That’s the recommended way

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?