Build Your Own Business Website header image

Welcome to our Members Only Forum

You are welcome to view the content on our Forum, just scroll down to view this forum post.
If you like what you find and want to be able to post a question, please check out our subscription options.
Please feel free to search the forum using either the Google Site Search above or the forum search below.

Avatar
Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Create a Responsive Skin
Avatar
Carol Nourse
Member
Members

Community Member
Forum Posts: 7
Member Since:
December 2, 2013
sp_UserOfflineSmall Offline
1
January 7, 2015 - 5:39 am
sp_Permalink sp_Print

Hi Rick - apologies if this isn't the correct thread for this question:

I’ve been following the ‘Create a Responsive Skin’ course enthusiastically for several weeks and have nearly completed my website. However, I cannot access any of the videos relating to the final lesson – lesson 10.  Is it just me or are they not available generally?

Thank you

Carol

Avatar
Rick Anderson
Desert Hot Springs, CA
Admin
Forum Posts: 13616
Member Since:
November 8, 2009
sp_UserOfflineSmall Offline
2
January 7, 2015 - 7:29 am
sp_Permalink sp_Print

Carol - Lesson 10 had some huge errors in it so I removed the videos.

Are you building your skin in Thesis 2.1?

Avatar
Carol Nourse
Member
Members

Community Member
Forum Posts: 7
Member Since:
December 2, 2013
sp_UserOfflineSmall Offline
3
January 7, 2015 - 9:22 am
sp_Permalink sp_Print

Hi Rick - yes, I am.  What a shame about lesson 10!

Mainly, I was hoping to get information about how to enqueue javascript.

Avatar
Keith W Jones
Somerset, UK
Member
Members

Community Member
Forum Posts: 1359
Member Since:
June 22, 2013
sp_UserOfflineSmall Offline
4
January 8, 2015 - 4:05 pm
sp_Permalink sp_Print

Carol

First I would read the codex:

Click Here

In particular the parameters and whether the script is already included in WP. The examples I do not think are going to help you.

To add to your skin you add code to skin.php, now hoping that Rick has a simple way to explain it for you.

Keith

Keith W Jones
Make sure you backup before upgrading and making changes.
Best results when one question per thread, link to site, version of WP, Thesis and skin.
http://www.kwjassociates.co.uk - Wordpress 4.9.8 – Thesis 2.6.4 - Pearsonified 1.3
Avatar
Rick Anderson
Desert Hot Springs, CA
Admin
Forum Posts: 13616
Member Since:
November 8, 2009
sp_UserOfflineSmall Offline
5
January 11, 2015 - 9:57 am
sp_Permalink sp_Print sp_EditHistory

Also - if you watch the Advanced Box Development seminar you will see how to enqueue javascript from within a box.  This is roughly the same as doing it from within a skin except that the skin doesn't have a preload() function.

So, you set up a function for loading the script and then you call that function from within the construct() method

Something like:

protected function construct() {
// File constant for URL of the skin folder
if (!defined('BYOBPTSD1_URL')) {
define('BYOBPTSD1_URL', THESIS_USER_SKINS_URL . '/ptsd_lesson_1');
}
if(!is_admin()){
add_action('wp_enqueue_scripts', array($this, 'add_scripts_and_styles'));
}
}

public function add_scripts_and_styles() {

wp_enqueue_script('imagesloaded', BYOBPTSD1_URL . '/js/imagesloaded.pkgd.min.js', array('jquery'), '', true);
}

Avatar
Carol Nourse
Member
Members

Community Member
Forum Posts: 7
Member Since:
December 2, 2013
sp_UserOfflineSmall Offline
6
January 12, 2015 - 6:55 am
sp_Permalink sp_Print

Thank you Keith and Rick - I'll take a good look through both the Wordpress codex and the Advanced Box Development seminar.  

Carol

Avatar
Keith W Jones
Somerset, UK
Member
Members

Community Member
Forum Posts: 1359
Member Since:
June 22, 2013
sp_UserOfflineSmall Offline
7
January 12, 2015 - 7:48 am
sp_Permalink sp_Print

Carol

Whilst I am sure that Rick's code is good, watch out for the curly " and curly '. From past experience they will not work.

Often happens when cutting and pasting.

Keith

Keith W Jones
Make sure you backup before upgrading and making changes.
Best results when one question per thread, link to site, version of WP, Thesis and skin.
http://www.kwjassociates.co.uk - Wordpress 4.9.8 – Thesis 2.6.4 - Pearsonified 1.3
Avatar
Rick Anderson
Desert Hot Springs, CA
Admin
Forum Posts: 13616
Member Since:
November 8, 2009
sp_UserOfflineSmall Offline
8
January 12, 2015 - 8:46 am
sp_Permalink sp_Print

Yes - please make sure you don't get "smart" quotes when you copy - this is an irritating byproduct of my continuing conflict with syntax highlighting in the recent version of the forum.

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 228

Currently Online: Marcy
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Keith W Jones: 1359

Brian Tozer: 1004

Carolin: 979

Heidi Hafner: 466

John Cunningham: 422

Reece Morrel: 353

Newest Members:

David

Dina Jokanovic

kwitchey

Kirk Ewing

Md Saifullah

Ian Birch

Forum Stats:

Groups: 8

Forums: 46

Topics: 6942

Posts: 34509

 

Member Stats:

Guest Posters: 6

Members: 6743

Moderators: 2

Admins: 2

Administrators: Rick Anderson, Rick Anderson

Moderators: Pierre Cote, Laura Nugent