Home › Forums › WoodMart support forum › Portfolio detail page Title (H1)
Portfolio detail page Title (H1)
- This topic has 12 replies, 2 voices, and was last updated 5 years, 5 months ago by
Artem Temos.
-
AuthorPosts
-
September 25, 2019 at 12:24 pm #146544
ColibriParticipantHi,
In regards to the last week’s topic I’ve started for the H1 title of the single portfolio page. (see here https://xtemos.com/forums/topic/portfolio-detail-page-title-h1/), I’ve dicovered a bug. The main Services page (where you have the list of all the services) has now the H1 title the same as the first portfolio item.
Can you adjust the code snippet previously provided to remedy this problem?
September 25, 2019 at 1:12 pm #146555
Artem TemosKeymasterHi,
Try to replace previous code with this one
if ( is_singular( 'portfolio' ) ) { $title = get_the_title(); }
Regards
September 25, 2019 at 1:30 pm #146564
ColibriParticipantThe current code is:
if( is_singular( ‘page’ ) && ( ! $page_for_posts || ! is_page( $page_for_posts ) ) ):
$title = get_the_title();Do I also change the if before the line mentioned or just the second line?
Thanks!
September 25, 2019 at 1:51 pm #146571
Artem TemosKeymasterWe have you a single line only, replace that line with a new code https://xtemos.com/forums/topic/portfolio-detail-page-title-h1/#post-144339
September 25, 2019 at 1:59 pm #146575
ColibriParticipantI’ve replaced as you said and now the code looks like this: http://prntscr.com/patq2b
and the page looks like this: http://prntscr.com/patow0
The title doesn’t show at all. I don’t think I did it right.
September 25, 2019 at 2:24 pm #146586
Artem TemosKeymasterSorry, the code should be look like this https://prnt.sc/pasv3l
$title = get_the_title( $page_for_projects ); if ( is_singular( 'portfolio' ) ) { $title = get_the_title(); }
September 25, 2019 at 3:05 pm #146605
ColibriParticipantThank you ! Now the title displays correctly, but the breadcrumb still says “project”
See here: http://prntscr.com/pauvkn
September 26, 2019 at 6:39 am #146712
Artem TemosKeymasterYou can translate or edit all theme and plugin texts including this one via PO file in WordPress. Here is a video tutorial that should help you translate your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
We suggest you to keep translated files in wp-content/languages/themes/woodmart-pt_PT.po folder.
September 26, 2019 at 7:33 am #146722
ColibriParticipantWhen I first renamed the page Portfolio to Services the breadcrumb was displaying correctly.
The thing is, I am already using WPML because the site is multi-language. I can translate the breadcrumb as a string for Romanian, but what can I do for the English version of the site, can it still be changed using the English PO files?
Thanks for all the help so far!
September 26, 2019 at 7:44 am #146725
ColibriParticipantWhen you load the Services page (Portfolio list page) the breadcrumb displays like this: http://prntscr.com/pb52yj
But, when you load a Single Portfolio page, the breadcrumb displays like this: http://prntscr.com/pb51szBoth breadcrumbs refer to the same page, there must be a bug in the code.
I have also searched for the string “project” in the PO file and using WPML String Translation and I haven’t found it anywhere. So, I have no way to translate it or edit it.
Hope you can help me out with this.
September 26, 2019 at 7:59 am #146738
Artem TemosKeymasterCould you please send us your admin access so we can check why you can’t find it?
September 26, 2019 at 1:07 pm #146823
ColibriParticipantHi,
I eventually found it (I was searching for it with lowercase). Now it works. Thank you for the help!
My current problem in regards with this page’s translation is the slug. I have translated the Romanian version of the page and changed it’s slug to /servicii/. But, when I use the language switcher from English to Romanian, the url of the page keeps the /services/ slug, although if I type the translated version it’s also valid, and loads the same content. Please see the screen shots.
I have also previously used a snippet of code that you provided from another topic regarding the changing of the slug:
add_filter(‘register_post_type_args’, ‘portfolio_to_my_slug’, 10, 2);
function portfolio_to_my_slug($args, $post_type){if ($post_type == ‘portfolio’){
$args[‘rewrite’][‘slug’] = ‘services’;
}return $args;
}September 26, 2019 at 1:47 pm #146841
Artem TemosKeymasterIt seems to be a general WPML issue not related to the theme. Contact WPML support for in this situation.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register