-
AuthorPosts
-
July 22, 2014 at 1:22 pm #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, 4 months ago by Morticka.
July 22, 2014 at 1:28 pm #294309Hey Morticka!
Please try adding following code to Functions.php file in Appearance >Editor
removed
Cheers!
Yigit- This reply was modified 10 years, 4 months ago by Yigit.
July 23, 2014 at 1:08 pm #294931Hi 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,
MortickaJuly 23, 2014 at 4:42 pm #295015Hi 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!
YigitJuly 26, 2014 at 3:38 pm #296227Hi Yigit,
I edited and moved the (complete) files into the child theme, but nothing happened?
Sincerely,
MortickaJuly 28, 2014 at 4:37 pm #296854Hey!
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,
PeterJuly 28, 2014 at 6:02 pm #296924Hi 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,
MortickaJuly 29, 2014 at 5:00 am #297151Hey!
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!
IsmaelJuly 29, 2014 at 10:07 am #297212This reply has been marked as private.July 30, 2014 at 12:03 pm #297651Hi 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,
MortickaJuly 31, 2014 at 3:18 am #298065 -
AuthorPosts
- The topic ‘Change Blog – latest posts and Archive for category in child-theme functions’ is closed to new replies.