Ticker

6/recent/ticker-posts

Ad Code

Responsive Advertisement

How to add Genesis Scripts Support on WordPress Custom Post Type?

How to add Genesis Scripts Support on WordPress Custom Post Type

Genesis WordPress framework comes with lots of great features. We are using GenesisWP Framework since more than 10 years and it’s been awesome journey.

Recently we have enabled new Custom Post Type section called Guides on Crunchify.

Today I’ve noticed, while publishing Custom Post Type, I didn’t see Scripts section WordPress Edit post section.

How to Enable Genesis Scripts on Custom Post Types? Let’s start working with Custom Post Types. How to load certain scripts only on single pages?

Adding a script to the edit & create admin pages for a custom post type. In order for Scripts section to be appeared at the bottom of Edit post page just add below code to your Genesis theme’s Child theme’s functions.php file.

add_post_type_support( 'guides', 'genesis-scripts' );

That’s it. Save functions.php file and refresh your page. You will see Genesis Scripts section now.

Why I use Genesis Scripts section?

On Crunchify, I have disabled WordPress Embed script globally site wide. That means wp-embed.min.js is not loading on any of pages except I put it in Scripts section.

Want to see live example?

Oh yeah. You are on right post 🙂

On this page I’ve added below script and that’s why above embed post is showing the way it should.

<script type="text/javascript" src="https://cdn.crunchify.com/wp-includes/js/wp-embed.min.js"></script>

Enjoy and happy blogging!

The post How to add Genesis Scripts Support on WordPress Custom Post Type? appeared first on Crunchify.

Enregistrer un commentaire

0 Commentaires