-
AuthorPosts
-
January 25, 2016 at 11:09 pm #571666
I have two sites that are almost identical and was able to get the english site to show the post title but wasn’t able to get the post title to show up on my spanish site. I have shown my functions.php file below.
Do you have any tips on how I can get this to work for both sites?
<?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 }
I can see that the title on my site is hidden with CSS but the title shows up below the featured image and is supposed to be shown in the top title bar.
I have tried my best to read through the form and documentation but haven’t been able to solve this.
January 26, 2016 at 2:10 am #571778Hi bsomme1!
Is it your blog page? Can you send us a link to the exact page where the titles are not displaying?
Are you sure you have translated the posts and the categories?
Cheers!
ElliottJanuary 27, 2016 at 9:49 am #572702Hi Elliott,
Thanks for the quick reply. I apologize for not having the link in the post. The page I am referencing can be found here: http://www.delitosfinancieros.org/noticias/. Any of the articles that are linked to from that page are not showing the post title (ex. http://www.delitosfinancieros.org/oficiales-de-cumplimiento-preocupados-por-sentencia-de-juez-que-los-hace-responsables-por-fallas-en-los-programas-ald/). Instead it simply says “Últimas entradas” which translates to “Latest Posts”.
On our other site this is working fine ex. http://acfcs.org/news/ any post linked to from this page has a title. For example, this page http://www.acfcs.org/judges-ruling-affirming-individual-penalties-allowed-in-aml-program-failures-sets-a-bad-precedent-says-compliance-officer/.
January 28, 2016 at 6:55 am #573514Hey!
Please replace the following code:
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; }
.. with this:
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'] == 'Últimas entradas' ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
Cheers!
IsmaelJanuary 28, 2016 at 5:55 pm #573916Hi Ismael,
Thanks for the tip. I tried this and it didn’t correct the issue though. I have pasted my Functions.php code below. Thanks again for your help.
<?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'] == 'Últimas entradas' ) { $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 ACFCS Forum. Please take time to review our terms of use before posting on the forum. Thank you for helping make this community!</div>' ; }
February 1, 2016 at 7:34 am #575586Hey!
Alright. Please replace the code with this:
add_filter('avf_title_args', 'fix_single_post_title', 10, 2); function fix_single_post_title($args,$id) { if ( is_singular('post') ) { $args['title'] = get_the_title($id); $args['link'] = get_permalink($id); $args['heading'] = 'h1'; } return $args; }
Regards,
IsmaelFebruary 1, 2016 at 8:06 pm #575997Thank you so much. That worked perfectly.
-BradFebruary 2, 2016 at 8:40 am #576303 -
AuthorPosts
- You must be logged in to reply to this topic.