Skip Navigation

[Resolved] Newbie questions: Child Theme, Best Practices, JavaScripts

This support ticket is created 7 years, 6 months 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 7 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#519574

I am trying to:

1. I installed the sample magazine site from the framework installer.
Then I tried to upload the toolset starter child theme 1.1, the layout and css files seem to be off.
Does anyone know what css rules/ files i would probably need to change to to the child theme so that i start clean with the child theme?

2. On one of the post I need to include a javascript snippet just for that post only. (a javascript example). Where should I put it?

I think I might need to add custom javascript codes to different pages from time to time, with each page having its set of javascript code.

Should I create new custom post fields and put my scripts there? I have seen example for adding custom fields, but I am unsure how I can connect all the pieces together. If so, is there any tutorial where can point me to that?

Thanks!

#519598

I figured out the first part finally.

I needed to go to the Toolset Theme -> Custom CSS and copy and paste the content into the child theme style.css. Once that part is done, the layout and style all look fine.

I am still need some assistance for the javascript questions, however. any help will be greatly appreciated!

#519662

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - to add javascript to specific page you can use WordPress hook "wp_enqueue_scripts":

For example:

function enqueue_files() {
  if ( is_page( 'your-page' ) ) {
    // enqueue specific page script files here
  } else {
    // enqueue common scripts here
  }
}
add_action( 'wp_enqueue_scripts', 'enqueue_files' );

You may try the following plugin:
=> https://wordpress.org/plugins/scripts-n-styles/

Please check following URLs:
=> https://wordpress.stackexchange.com/questions/22951/how-to-enqueue-scripts-on-custom-post-add-edit-pages
=> https://wordpress.stackexchange.com/questions/193489/add-javascript-to-single-post
=> https://wordpress.stackexchange.com/questions/123447/how-to-add-a-js-file-only-in-one-specific-page-dynamically-to-head
=> https://wordpress.stackexchange.com/questions/67802/most-efficient-way-to-add-javascript-file-to-specific-post-and-or-pages

#519995

Thanks for the speedy response and these resources!

I was hoping for an elegant solution w/o modifying the php files, and I will try to use the plug-ins. So I guess it is not currently doable within ToolSet itself? Is there any plan for the future?

Also, for the ToolSet plugins it seems that it loads lots of jquery + font awesome + other plugins css and js. Is there anyway to specify them to use the CDN version? I know font awesome and jquery do have many other CDN out there.

Thanks!

#520165

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I was hoping for an elegant solution w/o modifying the php files, and I will try to use the plug-ins. So I guess it is not currently doable within ToolSet itself? Is there any plan for the future?
==> Well - its good if you go for any other plugin as there is no such feature available not.

Also, for the ToolSet plugins it seems that it loads lots of jquery + font awesome + other plugins css and js. Is there anyway to specify them to use the CDN version? I know font awesome and jquery do have many other CDN out there.
==> There is no such feature available to use CDN version. But I will discuss this with our developers.