Upgrading Pro broke portfolio child theme modification

Hello I was using the following code to have portfolio items go to assigned pages. When I upgraded Pro it broke. Please advise as this runs much of the website: https://www.experiencepinpoint.com

Click any portfolio thumbnail and it goes to a blank portfolio page, not the page it’s been assigned to go to. Thanks for the help

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );

// Additional Functions
// =============================================================================

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) {

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;

}

function alnp_support() {
add_theme_support(‘auto-load-next-post’);
}
add_action( ‘after_setup_theme’, ‘alnp_support’ );

add_filter(‘essgrid_query_caching’, ‘eg_disable_chache’, 10, 2);
add_filter(‘essgrid_get_posts’, ‘eg_mod_posts’, 10, 2);

function eg_mod_posts($query, $grid_id){

if($grid_id == 21){

$exclude_id = get_queried_object_id();
$query[‘post__not_in’] = array( $exclude_id );

}

return $query;

}

function eg_disable_chache($do_cache, $grid_id) {

if( $grid_id == 21 ) {
return false;
}

}

I have moved this problem to our staging site: http://pinpointpromo.staging.wpengine.com

Hi There,

Thanks for writing in and the URL!

I checked your staging URL portfolio page and all of your portfolio items are going to right page.

Let us know if you are looking for something else in the page.

Thanks

Hi if you click on the portfolio thumbs here: (what you’ve taken a screen shot of) https://pinpointpromo.staging.wpengine.com/our-work/

and then here on the live site you will see the difference:
https://www.experiencepinpoint.com/our-work/

The code above is in my child theme and I had gotten here on this forum officially to make porfolio items go to pages to have full control over the page rather than being locked into the portfolio theme

Hi There,

The live URL also working as expected.

Can you send me a same screencast video of your issue.
I am not able to reproduce here.

Thanks

Yes the live version is now working because I reverted back to Pro 1.X. This is how it’s supposed to function.

The stage site here https://pinpointpromo.staging.wpengine.com/our-work/ is updated to Pro 2.X (latest release) and is causing the thumbnails to go to blank portfolio pages not the pages they go to on the live site

Hello There,

I have clicked all the thumbnails in your staging site and it goes to the correct pages. I could not replicate the issue the thumbnails to go to blank portfolio pages not the pages. Could you please provide us the details which of the thumbnails is going to a blank portfolio item page?

Thank you in advance.

You’re right. It’s broken everywhere I have a “recent posts” embedded. So any thumbnail on the homepage (Pirelli, Wango Tango, Xfinity etc)

Hi @PinpointPromos

I couldn’t reproduce this issue on your staging site on the homepage as well, please check this video screencast:

Could you please let us know how we can reproduce this issue?

Thanks.

Hey @PinpointPromos,

I’ve tested the filter used for changing or remapping the portfolio item link and yes, it does not work now. There must have been changes in WordPress that caused this. It only works in the permalink section only.

But, it actually does not change the actual permalink of the post type. I’m not sure if this is a bug in WordPress but this surely is not an issue with the theme therefore we could not support this or make it work. I’m sorry that you were not informed that custom development is outside the scope of our support. That is even you got the code from this forum. They were only meant to be a guide and there’s no guarantee they’ll work in the future. I’m sorry that your expectation has not been handled properly. Please see our Terms.

Please change your setup to one of the bundled grid plugins. The setup is easier that way and we support them. You can choose between Essential Grid or The Grid.

We’re sorry for the inconvenience this has caused you.

I may have to simply 301 redirect all portfolio items, that would probably fix (patch) it

Also it’s not changes in Wordpress, it’s the theme because it breaks when I upgrade from 1.X to 2.X

I see. Regardless of the cause though, since it’s not the intended behavior of the Recent Post and X Portfolio, we could not make this custom code work again as that would require us to spend custom development time which is not a part of our support service.

A redirect would be the quickest solution to this.

Thank you for understanding.

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