Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #294302

    Hi guys,

    I would like to change both titles and have found the answer here: https://kriesi.at/support/topic/change-text-of-main-title/#post-167849

    But, I am using a child theme and I don’t want to edit the Enfold theme’s files. (I am also not using the option: Where do you want to display the Blog in theme settings for navigational purposes)

    How can I do this in functions.php in my child theme?

    Sincerely,
    Morticka

    • This topic was modified 10 years, 5 months ago by Morticka.
    #294309

    Hey Morticka!

    Please try adding following code to Functions.php file in Appearance >Editor

    removed

    Cheers!
    Yigit

    • This reply was modified 10 years, 5 months ago by Yigit.
    #294931

    Hi Yigit!

    Thanks for your fast response as always ;)

    But, this does not do anything?

    I’ve seen in another post that this is because the blog option is not selected in the theme settings, but like I said before, I do not want to do that because of navigational purposes (separate landingpages for each menu item including subitems, separate topics etc)

    So, I would like to change “Blog – Latest Posts” into something of my own choosing and “Archive For Category” as well. And I would like to do it in my childtheme, so I do not disturb the main Enfold files.

    Do I have to copy certain .php files and put them in my child theme directory via ftp? And if so, which code do I keep and which code do I change?

    Sincerely,
    Morticka

    #295015

    Hi Morticka

    You should edit the files and move to your child theme in the same path. For example, if you edit avia.js files that is JS folder, it should go to Enfold-child/js/avia.js

    Cheers!
    Yigit

    #296227

    Hi Yigit,

    I edited and moved the (complete) files into the child theme, but nothing happened?

    Sincerely,
    Morticka

    #296854

    Hey!

    Try this code – insert it into the child theme functions.php file:

    
    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
    		if ( is_category() )
    		{
    			$output = __('Archive for category:','avia_framework')." ".single_cat_title('',false);
    		}
    		elseif (is_day())
    		{
    			$output = __('Archive for date:','avia_framework')." ".get_the_time( __('F jS, Y','avia_framework') );
    		}
    		elseif (is_month())
    		{
    			$output = __('Archive for month:','avia_framework')." ".get_the_time( __('F, Y','avia_framework') );
    		}
    		elseif (is_year())
    		{
    			$output = __('Archive for year:','avia_framework')." ".get_the_time( __('Y','avia_framework') );
    		}
    
    		if(!empty($output)) $args['title'] = $output;
    
    return $args;
    }
    

    Regards,
    Peter

    #296924

    Hi Peter,

    Thx for your response, but nothing changed :)

    First I tested with edited index.php and the file in the framework file in my child theme and then I removed both files, but nothing happened?

    Sincerely,
    Morticka

    #297151

    Hey!

    Thank you for the update.

    Please post an actual page where you want to change the title. The code works well when I tested it. Note that the code Dude suggested hasn’t been modified yet so it will show the default output of the avia_which_archive function. If possible, please post the login details here. We would like to check it.

    Cheers!
    Ismael

    #297212
    This reply has been marked as private.
    #297651

    Hi Guys,

    Never mind, I solved all three myself!! (With a little *cough* code help from you guys ofcourse ;))

    Here are the solutions:

    1. Changing Blog – Latest Posts into the name of the category the post is in: https://kriesi.at/support/topic/change-the-title-blog-latest-news-on-single-to-category/
    2. I used the code Peter gave me and changed this line: $output = __(‘Archive for category:’,’avia_framework’) where I put something else in place of Archive for category
    3. Both changes worked in my child theme. I copied single.php (see 1.) to my child theme and editted the code there. For 2. I editted functions.php in my child theme.

    Works like a charm!!

    Sincerely,
    Morticka

    #298065

    Hey!

    Glad you figured it out. :)

    Cheers!
    Ismael

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Change Blog – latest posts and Archive for category in child-theme functions’ is closed to new replies.