Skip Navigation

[Gelöst] Product Page as CPT

This support ticket is created vor 6 Jahren, 7 Monaten. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Dieses Thema enthält 5 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Nigel vor 6 Jahren, 7 Monaten.

Assistiert von: Nigel.

Author
Artikel
#775271

Hello,

The following topic was closed while I was on break: https://toolset.com/forums/topic/product-page-as-cpt/page/2/#post-775269

Is it possible to resume this topic discussion?

#776470

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi Chuck

I see from the previous thread that I was waiting for your feedback about the code I had suggested.

Do you want to bring me up to date?

#778394

Hello,

I returned yesterday from a two-week break and shared your information with server support and discovered there was another code loaded that a Toolset coleugue provided related to CPT. Can you please take a quick look to see if there is any redundancy or conflict with the code you recommended?

That topic thread is: https://toolset.com/forums/topic/types-set-up/

Specifically the following coded:

add_filter( 'wpv_filter_query', 'post_type_filter_func', 10, 3 );

function post_type_filter_func( $query_args, $settings, $view_id ) {
$views = array( 1234,5678 );
if ( in_array( $view_id,$views) && isset($_GET['wpv-post-type'][0]) && !empty($_GET['wpv-post-type'][0]) ) {
$query_args['post_type'] = $_GET['wpv-post-type'][0];
}
return $query_args;
}

I want to make sure there is no conflict with implimenting your recommendation. Also, I will be attempting to integrate Toolset with an actual live site instead of a staging clone as before.

#786618

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi Chuck

I looked back at the suggestions I had made and at the code suggested by Christian for filtering by post type, and I don't foresee any conflicts, they use different hooks and serve different purposes and won't step on each other's toes.

#787129

Thank you for the confirmation. I appreciate it.

I will proceed to upload the code you provided and update this ticket.

#802605

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi Chuck

Let me just mark this as awaiting feedback from you so that it's not sitting in my queue.