[X THEME] Portfolio project link OPEN in the SAME page

Hello friends, my problem is this:
The portfolio link project opens in a new page but I would like to change this to open in the same page.
I could see previous post with similar problems but the post are old with other xtheme’s versions.

I’m sorry for my english.
Thanks so much.
Regards.

Hello @skullbag,

Thanks for asking. Can you please share website URL for us to take a closer look?

Thanks.

Thank you for answering!

The web is in maintenance but I opened for you the portfolio and one item portfolio for you take a closer look :slight_smile:

URL: https://skullbag.es/portfolio/
URL ITEM PORTFOLIO: https://skullbag.es/portfolio-item/ortoleon/ (when you click in “ver proyecto ahora”, the link open in a new page and that’s not my idea, it must open in the same page.

Thanks so much!!

I forgot to tell you that I’m using X-CHILD theme.

Thank you!!

Hello @skullbag,

Thanks for asking. :slight_smile:

As you have already installed child theme, all you need to do is copy portfolio.php file from /wp-content/themes/x/framework/functions/global/ and paste under /wp-content/themes/x-child/framework/functions/global/. You may need to create additional folders.

Next you need to focus on line number 241 that starts with <a href="<?php echo $project_link; ?> and in that line replace target="_blank" with target="_self". This will make portfolio button link to open in same page.

Please note that custom development falls outside the scope of support we offer but I have tried to point you in right direction believing that it will be your responsibility to take from here on.

Thanks.

Thank you!

I did your indications but the theme not recognize it. Why?

The routes are correct: /wp-content/themes/x-child/framework/functions/global/portfolio.php
The portfolio line edited is correct: class=“x-btn x-btn-block” target="_self".

Some line may be missing in the functions.php from: /wp-content/x-child/ for the portfolio.php locate in /wp-content/themes/x-child/framework/functions/global/ can read it??
It would be like giving an order to x-theme about this change, or is not it necessary?

Thanks so much :smiley:

Hi There,

Without editing template files, simply add the following Javascript code into your Customizer, Custom > Edit Global Javascript area.

jQuery(function() {
  jQuery(".single-x-portfolio .entry-extra .x-btn.x-btn-block").attr("target","_self");
});

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.