I install the GeneratePress theme, I want to have custom javascript and style for specific post content template, I know how to assign the Hook elements to page but no idea how to assign to specific content template, content template is not a kind of post, it just a layout. Could you suggest me how I can make a hook to specific content template?
Hello. Thank you for contacting the Toolset support.
With the latest update, Toolset Blocks 1.5, the content template used by a post is no longer stored in postmeta table because of the conditional template assignment. Now we need to use the following filter to retrieve the ID of the template that will be used for a post using its $post object:
global $post;
$template_id = apply_filters( 'wpv_content_template_for_post', 0, $post );
You can use the above filter to get the template ID and based on that you can hook your custom CSS/JS.
Can you please share problem URL where you want to add the custom javascript and CSS and for what content template.
I will try to build to solution based on your actual requirement and then will share the solution.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I understand what you are looking for but there is no GUI offered for such things.
I tried to loggedin using the access details you shared but I do not able to access full site, even I do not able to access Toolset menu. If you can tell me to what content template and based on what condition you want to add some CSS or JS?
You may would like to check if that helps you, then you can set the condition accordingly and add a HTML element that will hold the CSS link you want to add.