Skip Navigation

[Resolved] Integration into current theme for custom post detail view

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to create a Content Template that will be applied to all the single Custom Post Type posts.

Solution: Create a Content Template and apply it to the Custom Post Type.

Relevant Documentation: https://toolset.com/documentation/user-guides/view-templates/

This support ticket is created 7 years, 1 month ago. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 21 replies, has 2 voices.

Last updated by lanceS-5 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#561694

Hi

Currently I am building a web components for a client within their current website theme that they bought from themeforest for wordpress.

I have a few custom post like pride listings, locations etc...

For the archive type pages its easy I can just create views on a standard landing page (not perfect but should work ok ish). As you cans see from the example page hidden link

The tricky bit is the detail view of these individual post that want to use single view template for the blog post.

I have noticed in your online documentation that you have removed the way to do this as you are currently working on a new solution.

Is there a work around that can be done in the meantime as I am not using

Thanks for your help in advance!!

#561754

The tricky bit is the detail view of these individual post that want to use single view template for the blog post
Hi, if you're not using Layouts, you can try to use a Content Template and assign that Content Template to your single Events Listing post type. We have some more details about creating Content Templates here:
https://toolset.com/documentation/user-guides/view-templates/

This should keep the overall site design and structure provided by your theme, but allow you to design the main content area of each event listing post. Please let me know if this isn't what you're trying to achieve, and we can take another look.

#562855

Sorry for the late reply. Thank you so much I will take a look and get back to you. Do I understand you correctly I would still use a static page that I assign to a theme template and use the content template in the page for detail view?

#562897

Do I understand you correctly I would still use a static page that I assign to a theme template and use the content template in the page for detail view?
I think that you will use a static page to display the View listing Events Listings posts, yes. You can choose to apply your own Content Template to all static Pages, or you can allow your theme's templates to be used on all pages.

Each item in the View will include a link to a Listing's single post page - assuming Listings are a custom post type managed by Types. You can create a Content Template and apply it to all the Listings single post pages. So you don't need to create a static Page for each Listing - each Listing should have its own single post page already. I hope this helps clarify things.

#562911

I tried it for both detailed view and taxonomies and I am not sure if i am missing something but it only shows the archive view in the breadcrumbs.

#562927

Hi, Toolset isn't designed to modify the breadcrumbs produced by your theme. If you have an issue with breadcrumbs, it's probably best to create a separate ticket so we can investigate that as a separate issue. It might be possible to tweak a setting or configuration in your theme that will enable breadcrumbs for custom post types, but it's possible your theme just isn't designed to support custom post types in its breadcrumbs.

#562930

My apologies sorry for the misunderstanding, I meant that the only way I know which page is displaying the detailed view was that the breadcrumb said its the "archive page" i.e.: hidden link

I created 2 content templates 1 for the detail view for events listings and 1 for detail view of the categories for the events listing, the category list view it shows the archive page, for the detailed view and for the events listing single view it shows the blog view pages as you can see here: hidden link

I hope this helps?

#562964

It sounds like you're saying that this page is okay:
hidden link
Did I understand this correctly?

It sounds like you're saying this page is wrong:
hidden link
Did I understand this correctly?

I assume this is an WordPress Archive of posts that include the term "gay-sports-events" in the taxonomy "pride-category', is that correct? Can you show me a screenshot of the settings for the WordPress Archive you have assigned to the pride-category taxonomy? It appears that no posts are found. This could be because you have the settings incorrect.

#563075

It sounds like you're saying that this page is okay:
hidden link
Did I understand this correctly? This page is showing the blog single view side bars etc. Not correct

It sounds like you're saying this page is wrong:
hidden link
Did I understand this correctly? This page is also wrong.

I am sitting in an Ireland in Spain and internet is poor here can I give you my username and password instead? can I paste it here or will it be public available?

#563088

Please find the screenshot I managed to get

#563090
screenshot-ww1.pridefinder.com-2017-08-24-08-09-11.png

Try again

#563207

Okay I will enable private reply fields here so you can share login credentials.

#563352

This page is showing the blog single view side bars etc. Not correct
Okay I understand. The blog single view side bar is part of the theme's design, and isn't something Toolset controls. If you want to remove the sidebar from this page, it will require a change to the PHP template files. You should copy the contents of a full-width template file from your theme into a new file and call it single-pride_listing.php. Save that file into your child theme's folder. For the best results, I recommend contacting your theme's support team. Ask them for an example of a full-width single post template file and instructions on how to set it up for a post type with slug "pride_listing".

hidden link
This page is also wrong.
Let's look at an archive that actually has some results, for example the pride category "Gay Pride Festivals":
hidden link
What would you like to change on this page? Please tell me specifically what is wrong, and I will let you know what we can do to fix it.

#564872

I contacted the developers of the theme and they don't understand or won't help me with what I am asking for.

I created the a copy of the wide template which is used with all the pages as suggested in your previous post. What should I then do next?

#564905

I found a post online that could help me. Basically as I understand it it will based on the slug of the custom post automatically assign it to the single-cat-slug.php in a list.

if I added this code to function.php

/*
* Define a constant path to our single template folder
*/
define(SINGLE_PATH, TEMPLATEPATH . '/single');
 
/**
* Filter the single_template with our custom function
*/
add_filter('single_template', 'my_single_template');
 
/**
* Single template function which will choose our template
*/
function my_single_template($single) {
global $wp_query, $post;
 
/**
* Checks for single template by category
* Check by category slug and ID
*/
foreach((array)get_the_category() as $cat) :
 
if(file_exists(SINGLE_PATH . '/single-cat-' . $cat->slug . '.php'))
return SINGLE_PATH . '/single-cat-' . $cat->slug . '.php';
 
elseif(file_exists(SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php'))
    return SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php';
 
    endforeach;
}

and created a sub folder called /single which i did with all the single templates, see list below.

single-cat-post_tag.php
single-cat-pride-category.php
single-cat-pride-city.php
single-cat-prides-listing.php
single-cat-pride-location.php

but the only typical template i would like to use is the one that say "Default Template" but I can't find this one anywhere in the theme. If you can just point me in the right direction I think I should be able to take it from there.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.