Tagged: x
-
AuthorPosts
-
July 12, 2016 at 2:41 pm #1083665
luxmedesignerParticipantHi there,
I use the Project Link to invite people to get a quote. It works fine for English, but when I add the link to the Spanish translation, which includes “/?lang=es”, it removes it. I tried multiple times, but it keeps removing the last part of the code. Since both pages are named the same, it’s sending people to the English page, when it’s supposed to the sending them to the Spanish page.
How can I get it to work properly?
Thanks!
July 12, 2016 at 10:42 pm #1084178
DarshanaModeratorHi there,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
July 13, 2016 at 7:27 am #1084752
luxmedesignerParticipantHi there,
This is one of the pages in Spanish: http://www.tubularchainconveyors.com/portfolio-item/video-brush-stations/?lang=es
The idea is that the Blue Button (Project Link) goes to the Quote page: http://www.tubularchainconveyors.com/quote/?lang=es
But, as I explained, when I add the link, the last part is removed (?lang=es) sending the user to the English version instead.
Let me know if you can figure this one out!
Thanks!
July 13, 2016 at 8:59 am #1084885
ThaiModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link login to your site
– WordPress Admin username / passwordDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
July 13, 2016 at 9:50 am #1084959
luxmedesignerParticipantThis reply has been marked as private.July 13, 2016 at 10:35 am #1085047
luxmedesignerParticipantBTW: I tried adding a Project Link to this page: http://www.tubularchainconveyors.com/portfolio-item/installation-24/?lang=es
and in this case, the link is deleted completely. I think the Project Link field, in general, has a problem.
July 13, 2016 at 5:54 pm #1085761
FriechModeratorHi There,
You can not do that, that has some security concerns. You need to append the parameter
?lang=eson output, not on save.Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then on your child theme navigate to this directory \x-child\framework\views\integrity\ and create a file named content-portfolio.php and paste the code below.
<?php // ============================================================================= // VIEWS/INTEGRITY/CONTENT-PORTFOLIO.PHP // ----------------------------------------------------------------------------- // Portfolio post output for Integrity. // ============================================================================= $archive_share = x_get_option( 'x_integrity_portfolio_archive_post_sharing_enable' ); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-featured"> <?php x_portfolio_item_featured_content(); ?> </div> <div class="entry-wrap cf"> <?php if ( x_is_portfolio_item() ) : ?> <div class="entry-info"> <header class="entry-header"> <h1 class="entry-title entry-title-portfolio"><?php the_title(); ?></h1> <?php x_integrity_entry_meta(); ?> </header> <?php x_get_view( 'global', '_content', 'the-content' ); ?> </div> <div class="entry-extra"> <?php x_portfolio_item_tags(); ?> <?php x_portfolio_item_project_link2(); ?> <?php x_portfolio_item_social(); ?> </div> <?php else : ?> <header class="entry-header"> <h2 class="entry-title entry-title-portfolio"> <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a> </h2> <?php if ( $archive_share == '1' ) : ?> <?php x_portfolio_item_social(); ?> <?php endif; ?> </header> <?php endif; ?> </div> </article>Then add this on your child theme functions.php file.
// Output Portfolio Item Project Link // ============================================================================= function x_portfolio_item_project_link2() { $project_link = get_post_meta( get_the_ID(), '_x_portfolio_project_link', true ); $launch_title = x_get_option( 'x_portfolio_launch_project_title' ); $launch_button = x_get_option( 'x_portfolio_launch_project_button_text' ); if (isset($_GET['lang'])) { $xlang = '/?lang=' . $_GET['lang']; } else { $xlang = null; } if ( $project_link ) : ?> <h2 class="h-extra launch"><?php echo $launch_title; ?></h2> <a href="<?php echo $project_link . $xlang; ?>" title="<?php echo $launch_button; ?>" class="x-btn x-btn-block" target="_blank"><?php echo $launch_button; ?></a> <?php endif; }Hope it helps, Cheers!
July 14, 2016 at 7:42 am #1086719
luxmedesignerParticipantHi there,
The child theme already exists. The file content-portfolio.php already exists. I added the code to the functions.php page, but it didn’t work. Not sure what else I can do at this point. Any ideas?
July 14, 2016 at 11:37 am #1087048
JadeModeratorHi there,
Would you mind providing your FTP details so that we could check this further? Thank you.
July 14, 2016 at 3:53 pm #1087433
luxmedesignerParticipantThis reply has been marked as private.July 14, 2016 at 10:57 pm #1087991
FriechModeratorHi There,
Thanks for the credentials. Are you sure you’re looking on the child theme? I did not see a content-portfolio.php file on /wp-content/themes/x-child/framework/views/integrity/ directory, so I did go ahead and created it.
And also you did not copy the entire code for functions.php file. I did go ahead and update that as well.
Your button should work as you want it now.
Cheers!
July 15, 2016 at 7:14 am #1088383
luxmedesignerParticipantHi there,
Yeah, I installed the X child-theme and have been working on it from the beginning. That is so weird!
Anyway, I checked and the language code at the end is now appearing, so thank you so much!
I supposed this will work for any additional languages we add in the future, correct?
Cheers!
July 15, 2016 at 7:19 am #1088387
luxmedesignerParticipantFYI: This is a screenshot of the FTP configuration and the file is there. Not sure why you didn’t see it. I’m still confused!
Thanks again!
July 15, 2016 at 4:04 pm #1089069
FriechModeratorHi There,
Yes, it should work with the future language you added assuming you implement it the same way as the Spanish.
I think you are looking on a different site files. Here’s what I have and the content-portfolio.php is the one I’ve added.
However, I saw the function I’ve given on the child theme’s functions.php file so yeah that is weird. Please contact your hosting support and ask them which files are for which site, they can help you better on this matter.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1083665 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>

