Skip Navigation

[Waiting for user feedback] Produce newsletter ready code

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.

This topic contains 3 replies, has 1 voice.

Last updated by Christopher Amirian 1 day, 13 hours ago.

Assisted by: Christopher Amirian.

Author
Posts
#2860189

Tell us what you are trying to do?
=> Remove the admin bar, remove all scripts, and inline css for posts of type newsletter

Is there any documentation that you are following?
=> not really

Is there a similar example that we can see?
=> Here's a post on the old version of the site
hidden link
=> Here's the same post on the new site
hidden link
=> Here's a sample post from the new site with my new newsletter post type
hidden link

Your assistance will be appreciated

#2860239

Christopher Amirian
Supporter

Languages: English (English )

Hello,

Welcome to Toolset support. I am not sure what we can help you with here.

Removing scripts or CSS is something related to the usage of the Toolset plugins or your theme's additional CSS code or any plugin that you use. So I am not sure what you mean by remove css and scripts.

Removing the admin bar from the front end is not a Toolset-related thing; it is a general WordPress thing from WordPress Dashboard > Users > Profile > Show Toolbar option.

Thanks.

#2860268

I'm trying all my support options in the hopes of finding the solution to this.

I plan to implement a simple filter could add to process the output as the last step in rendering the page. My previous versions were entirely written in php and all I had to do was avoid calling the footer hook. The new site is more advanced and I made these posts using built-in features of the theme, plugin, and toolset, but there's a lot of extra stuff in the resulting output. I'm exploring the use of perfmatters to do what I need.

Regarding the wp admin bar, I 've tried multiple implementations that are supposed to remove it from this post type, and none of them have worked. Perhaps you can recommend the best hook to use for that purpose. I don't want to remove it for all posts, just keep it from cluttering my code when I view this specific custom post type.

Thanks

#2860510

Christopher Amirian
Supporter

Languages: English (English )

Hi,

Toolset itself does not add a dedicated feature to strip all scripts/CSS from a specific post type output, so that part would mainly depend on the theme/plugins architecture or an optimization plugin such as Perfmatters.

For the admin bar specifically, since this is a custom post type condition, I would suggest using WordPress’ show_admin_bar filter conditionally for the newsletter post type.

add_filter( 'show_admin_bar', function( $show ) {

    if ( is_singular( 'newsletter' ) ) {
        return false;
    }

    return $show;
});

The other points are still ambiguous, as I do not know how Toolset is involved.

Please consider that we will not be able to help if there is custom code going on. But using Toolset, if you have questions, I will be happy to answer.

Thanks.