Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #754429

    Lely
    Moderator

    Hello Caleb,

    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 to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #755650

    LunaticStudios
    Participant
    This reply has been marked as private.
    #756252

    Rad
    Moderator

    Hi Caleb,

    This thread is about adding custom links to portfolio items through project link. I checked your portfolio items and there are no added project links. It should be under your portfolio item settings when editing it.

    And this code is not even added as suggested,

    jQuery(function($){ $('.page-template-template-layout-portfolio-php .x-portfolio a').attr('target','_blank') });

    Please add that code at your customizer’s custom javascript.

    Thanks!

    #756310

    LunaticStudios
    Participant

    X Staff,

    I understand what the thread is about, as I have only just started switching over my portfolio items to custom pages I haven’t had the chance to do all of the portfolio items. The reason I did not add that code was because as stated in thread, this just opens the portfolio item in a new tab. Which does not fix my problem. I probably should have been more specific about which items I have set up properly. The first few items of my ‘Arts & Design’ portfolio have been setup properly, specifically the following portfolio items ‘bugs’, ‘light cube’, ‘unleashed’, ‘energy paths’ and ‘streaks of fire’. However, only ‘bugs’ and ‘light cube’ work properly, the other portfolio items only reload the page. Sorry for not being clearer before, and thank so much for your support.

    Thanks,

    Caleb

    #756381

    Zeshan
    Member

    Hi Caleb,

    Thanks for updating the thread!

    Please try replacing the custom code you’ve added in your child theme’s functions.php file from this thread, with this:

    add_filter( 'post_type_link', 'x_remap_portfolio_permalink_to_project_link', 10, 4);
    
    function x_remap_portfolio_permalink_to_project_link($post_link, $post, $leavename, $sample) {
    
        GLOBAL $post;
    
        if ('x-portfolio' == $post->post_type) {
            $custom = get_post_custom($post->id);
    
            if (isset($custom['_x_portfolio_project_link']) && $custom['_x_portfolio_project_link'][0]!='')
                return $custom['_x_portfolio_project_link'][0];
        }
    
        return $post_link;
    }
    

    Let us know how it goes.

    Thank you!

    #756441

    LunaticStudios
    Participant

    X Staff,

    Unfortunately that did not solve the problem.

    Thanks

    #756457

    Rue Nel
    Moderator

    Hello There,

    Please edit each of the portfolio items. You have to make sure that each of the portfolio items has a custom project link. I have logged and checked Japan Dreaming for example. The project link is just #demo and this will not have any effect and will only reload the page.

    http://prntscr.com/9su5el

    Please keep in mind that in order for the custom code we gave to work, you have to create a corresponding page to each of your portfolio items and that each of these items has a custom project link which is the custom page.

    Hope this would help.

    #756597

    LunaticStudios
    Participant

    Hi,

    If you had read my previous post, you would have seen that I had not changed or setup all of the portfolio items yet. But I have setup some portfolio items with the changed and corrected project links as mentioned in the post to no avail. The attach image, you’ll be able to see that I have changed the project links to the link of the custom page, however when viewing the portfolio it just reloads the page. However, this is not the case for other portfolio items, mentioned in a previous post.

    Thanks,

    #756785

    Zeshan
    Member

    Hi there,

    Thanks for the clarification!

    Yes, I can see that links are only working on the first two portfolio items and not for the 3rd one. Upon looking at the source, I can see that the link is not defined at all (in the front-end of site only) and that’s why it’s reloading the same page (see: http://prntscr.com/9swosu). In this case, kindly open a separate thread and provide us with your URL, WordPress admin login and FTP login credentials in a private reply. You can do that by creating a new reply in your new thread and then selecting Set as private reply below the reply box.

    Thank you!

    #834073

    EPL
    Participant

    EDIT: Sorry, wrong topic 🙁 I deleted my comment

    #834312

    Rad
    Moderator

    No problem 🙂