-
AuthorPosts
-
January 20, 2016 at 11:06 pm #568931
I was wondering if there is an option to translate the theme. I am using the magazine feature and the links say “read more” instead of “LEER MÁS”.
Thanks,
BradJanuary 20, 2016 at 11:07 pm #568932Sure, you can use https://poedit.net/ to get po/mo files and upload them to /enfold/lang folder.
January 20, 2016 at 11:15 pm #568940April 8, 2016 at 8:22 am #610076Good morning.
I was wondering if you could help me troubleshoot an issue I am seeing as it relates to the title of pages in our Learn Dash courses. I am using the functions.php file below but am seeing the title show “Últimas entradas” for course pages instead of the title of the page. This translates to latest entries.This code was added to my functions.php file to remove that from articles which worked great. That said, it is still present on course pages inside of our LMS.
add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( $args['title'] == 'Últimas entradas' ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
Thanks so much for your help.
April 8, 2016 at 2:02 pm #610239Hi!
Can you please post the link to your page where you would like to edit your title?
Best regards,
YigitApril 8, 2016 at 2:15 pm #610256Please see the link to the page below. Since this is a course you won’t see content unless you are logged in. It still shows the same message though. Thanks for your help.
April 8, 2016 at 3:08 pm #610280Hi!
Can you please try adding following code to Functions.php
add_filter('avf_title_args', 'fix_single_post_title_cpt', 10, 2); function fix_single_post_title_cpt($args,$id) { if ( $args['title'] == 'Últimas entradas' && is_singular( 'sfwd-courses' ) ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
and replace “sfwd-courses” with your post type
Regards,
YigitApril 11, 2016 at 12:28 pm #611180Hi Yigit,
Thanks for your help. I have tried updating the functions.php file and replaced “sfwd-courses” with “courses”. I believe that is the custom post type for the “courses” feature but can’t be sure.In making those changes the title was not updated though.
Thanks
April 14, 2016 at 4:42 am #613423Hey!
Please update the code to something like this:
add_filter('avf_title_args', 'fix_single_post_title_cpt', 10, 2); function fix_single_post_title_cpt($args,$id) { if ( $args['title'] == 'Últimas entradas' || is_singular( 'courses' ) ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
We changed “&&” to “||” . If “courses” is not working, use “sfwd-courses”.
Best regards,
IsmaelApril 18, 2016 at 9:18 am #616196Unfortunately that didn’t work for me. I tried ‘courses’ and sfwd-courses but neither option changed the page title in the top bar.
April 19, 2016 at 3:58 pm #617502Hi!
can you provide us admin access, so we can check your functions.php, please? post login details here as private reply.
Regards,
AndyApril 27, 2016 at 8:30 am #622841Hi Andy,
Unfortunately I can’t provide login access to the admin panel of our site but I have listed the functions.php code that exists on the site today.
I could do a screenshare with you if you have some time available. I left my contact info in the pm section as well.
Thanks for your help.
Functions.php file
<?php // Opening PHP tag - nothing should be before this, not even whitespace // Custom Function to Include function favicon_link() { echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />' . "\n"; } add_action( 'wp_head', 'favicon_link' ); add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3); function avf_change_which_archive($output) { if(is_category()) { $output = __('','avia_framework').' '.single_cat_title('',false); } return $output; } add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 10, 2 ); function avia_append_search_nav ( $items, $args ) { if(avia_get_option('header_searchicon','header_searchicon') != "header_searchicon") return $items; if ((is_object($args) && $args->theme_location == 'avia') || (is_string($args) && $args = "fallback_menu")) { global $avia_config; ob_start(); $getform = get_search_form(false); $items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown">'.$getform.'</li>'; } return $items; } add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( $args['title'] == 'Blog - Latest News' ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; } add_action('wp_head' , 'remove_post_list_title_links'); function remove_post_list_title_links() { ?> <script id="remove-links-in-title" type="text/javascript"> jQuery(document).ready(function($) { $('.entry-title').each(function() { var $title_link = $('a[rel="bookmark"]' , $(this)), $title_text = $title_link.text(); $title_link.remove(); $(this).prepend($title_text); }); }); </script> <?php } function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' ); function bbp_tinymce_paste_plain_text( $plugins = array() ) { $plugins[] = 'paste'; return $plugins; } add_filter( 'bbp_get_tiny_mce_plugins', 'bbp_tinymce_paste_plain_text' ); add_action ('bbp_template_before_forums_index' , 'my_intro' ) ; Function my_intro () { Echo '<div class="entry-content">Welcome to the ACEDS Forum. Please take time to review our terms of use before posting on the forum. Thank you for helping make this community!</div>' ; }
April 29, 2016 at 3:25 pm #624561Hi,
Could be because of the accent in Ultimas, does the code works on the English version of the site?
Best regards,
JosueApril 29, 2016 at 3:30 pm #624565Hi Josue,
I have posted our English functions.php file below. This is working correctly so it is just the Spanish site that has the problem.
<?php // Opening PHP tag - nothing should be before this, not even whitespace // Custom Function to Include function favicon_link() { echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />' . "\n"; } add_action( 'wp_head', 'favicon_link' ); add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3); function avf_change_which_archive($output) { if(is_category()) { $output = __('','avia_framework').' '.single_cat_title('',false); } return $output; } add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 10, 2 ); function avia_append_search_nav ( $items, $args ) { if(avia_get_option('header_searchicon','header_searchicon') != "header_searchicon") return $items; if ((is_object($args) && $args->theme_location == 'avia') || (is_string($args) && $args = "fallback_menu")) { global $avia_config; ob_start(); $getform = get_search_form(false); $items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown">'.$getform.'</li>'; } return $items; } add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( $args['title'] == 'Blog - Latest News' ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; } add_action('wp_head' , 'remove_post_list_title_links'); function remove_post_list_title_links() { ?> <script id="remove-links-in-title" type="text/javascript"> jQuery(document).ready(function($) { $('.entry-title').each(function() { var $title_link = $('a[rel="bookmark"]' , $(this)), $title_text = $title_link.text(); $title_link.remove(); $(this).prepend($title_text); }); }); </script> <?php } function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' ); function bbp_tinymce_paste_plain_text( $plugins = array() ) { $plugins[] = 'paste'; return $plugins; } add_filter( 'bbp_get_tiny_mce_plugins', 'bbp_tinymce_paste_plain_text' ); add_action ('bbp_template_before_forums_index' , 'my_intro' ) ; Function my_intro () { Echo '<div class="entry-content">Welcome to the ACEDS Forum. Please take time to review our terms of use before posting on the forum. Thank you for helping make this community!</div>' ; }
April 29, 2016 at 4:34 pm #624628It’s because of the accent then, try changing the “U” for:
Ú
Best regards,
JosueMay 2, 2016 at 8:42 am #625537Hi Josue,
I have tried several variations of this but haven’t had any luck getting the title to change for my spanish translation yet.
Is this what you had recommended using?
add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( $args['title'] == 'Últimas entradas' ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
I have also tried this
add_filter('avf_title_args', 'fix_single_post_title_cpt', 10, 2); function fix_single_post_title_cpt($args,$id) { if ( $args['title'] == 'Últimas entradas' || is_singular( 'courses' ) ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
May 4, 2016 at 11:41 am #627101Hi,
I believe your courses slug is
sfwd-courses
. Try using that instead.Best regards,
JosueMay 4, 2016 at 11:55 am #627126I have tried this and a few other slugs but wasn’t able to get anything to work.
add_filter('avf_title_args', 'fix_single_post_title_cpt', 10, 2); function fix_single_post_title_cpt($args,$id) { if ( $args['title'] == 'Últimas entradas' || is_singular( 'sfwd-courses' ) ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
The URL of the page is http://www.delitosfinancieros.org/courses/ecnbvm/ and the class that shows up in the body tag is:
single single-sfwd-courses postid-15661 logged-in admin-bar stretched helvetica-neue-websave _helvetica_neue customize-supportI’m not sure where a course slug can be found but I also tried single-sfwd-courses.
Thanks for your help.
May 4, 2016 at 11:56 am #627128Hi,
Have you tried excluding the first condition, like:
if ( is_singular( 'sfwd-courses' ) )
Best regards,
JosueMay 4, 2016 at 11:59 am #627133I have changed this from is_singular to just is but that didn’t do anything. I’m not familiar with what I need to change.
May 4, 2016 at 12:56 pm #627164I’d like to to help you with this but at this point i’d need FTP access to test multiples codes and see which one can work.
May 16, 2016 at 10:10 pm #633329Sorry for the delay in getting a login for you. I have setup another environment for you to test things in.
Thanks again for your help.
- This reply was modified 8 years, 6 months ago by bsomme1.
May 17, 2016 at 1:32 pm #633733Hey!
I’m sorry but the wp-admin credentials are not working. What is the password to this page (http://www.delitosfinancieros.org/courses/ecnbvm/)? I can’t find it anywhere in the thread. We added the code again in the functions.php file of the child theme but it’s not working. Is the functions.php located in the enfold-child folder?
Cheers!
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.