CodeLobster IDE

Free cross-platform PHP IDE (HTML, PHP, CSS, JavaScript code editor) with support Drupal, Joomla, Twig, JQuery, BackboneJS, LaravelJS, Node.js, Fhalcon, CodeIgniter, CakePHP, Laravel, Magento, MeteorJS, Phalcon, Symfony, VueJS, WordPress, Yii
It is currently Sat Dec 14, 2019 2:46 am

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Why is my template not recognizig my scripts?
PostPosted: Sun Oct 28, 2018 4:57 am 
Offline

Joined: Sun Oct 28, 2018 4:53 am
Posts: 2
Not sure if there is a WordPress forum here; I didn't see one but I hope one of you gurus can help me.

I created a WordPress custom template called Contact-Us

I am using AngularJS and Html to create additional input textboxes dynamically.

This works great.

However, when I created a WordPress template and converted the code to php, none of the scripts on my header section is being recognized.

For instance, the dynamic textbox creation is no longer working.

Is there something wrong with the way I am referencing the scripts?

Note: I have the script in functions.php file. Here it is.

Code:
add_action('wp_enqueue_scripts', 'scripts_styles');
function scripts_styles(){
if(is_page_template('Contact-Us.php')){
wp_enqueue_script('jquery', get_template_directory_uri().'/js/jquery.min.js');
wp_enqueue_script('bootstrap', get_template_directory_uri().'/js/bootstrap.min.js');
wp_enqueue_script('handlebars', get_template_directory_uri().'/js/handlebars.min.js');
wp_enqueue_script('addrows', get_template_directory_uri().'/js/addrows.js');
}
}

Thanks in advance


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Mon Oct 29, 2018 1:33 pm 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi.

1. It’s important to namespace your functions with your theme name.
Use yourthemename_scripts_styles

add_action('wp_enqueue_scripts', 'yourthemename_scripts_styles');
function yourthemename_scripts_styles(){
...
}

2. if you create a child theme than use get_stylesheet_directory_uri() instead of get_template_directory_uri()


Regards,
Codelobster Team.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Fri Mar 22, 2019 10:18 pm 
Offline

Joined: Fri Mar 22, 2019 10:13 pm
Posts: 28
Admin wrote:
1. It’s important to namespace your functions with your theme name.
Use yourthemename_scripts_styles

add_action('wp_enqueue_scripts', 'yourthemename_scripts_styles');
function yourthemename_scripts_styles(){
...
}

2. if you create a child theme than use get_stylesheet_directory_uri() instead of get_template_directory_uri()


Somehow my codelopster php cannot download wordpress.
I stuck in the first loop Error message says cannot download wordpress.

Any help is highly appreciated.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Sat Mar 23, 2019 3:50 pm 
Offline

Joined: Fri Mar 22, 2019 9:57 am
Posts: 1
Same thing happened to me when I tried downloading Wordpress. Is there an issue with certain Wordpress versions or something?


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Sun Mar 24, 2019 1:11 pm 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi, EdwardMac.

1) Do You use latest version 1.5.1?
2) Are you able to install any other framework, for example CakePHP.

Thanks,
Codelobster Team.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Mon Mar 25, 2019 12:53 pm 
Offline

Joined: Fri Mar 22, 2019 10:13 pm
Posts: 28
Admin wrote:
Hi, EdwardMac.

1) Do You use latest version 1.5.1?
2) Are you able to install any other framework, for example CakePHP.

Thanks,
Codelobster Team.



Nice to see an Admin working on sundays ;)
I have the pro version 1.5.1 and when trying to open a project such as CakePHP it says

Quote:
Cannot create CakePHP project because error:
Critical error: Setup CakePHP error



https://imgur.com/br8GUMv


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Mon Mar 25, 2019 3:22 pm 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi.

What OS do You use exactly?
And what PHP version do You have?

Thanks,
Codelobster Team.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Mon Mar 25, 2019 6:49 pm 
Offline

Joined: Fri Mar 22, 2019 10:13 pm
Posts: 28
Admin wrote:
Hi.

What OS do You use exactly?
And what PHP version do You have?

Thanks,
Codelobster Team.



The Pro version 1.5.1 in Mint Linux 18.3.
PHP 7.0 plus my codelopster php cannot download wordpress.
I stuck in the first loop Error message says cannot download wordpress.
The project is in opt/lampp/htdos/xxxxx


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Tue Mar 26, 2019 7:37 pm 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi.

1) Does the following folder exist on your PC:
/home/your_user_name/.local/share/CodelobsterIDE
?

2) Does in contain wptmp.zip ?

3) Please, try to set the following values:

Location: /opt/lampp/htdocs/
Project name: xxxxx

4) Please, check "URL for the project" in the Advanced section.
It should be something like "http://localhost/xxxxx"

5) Please, check "Database Host".
May be it should be 127.0.0.1 instead of "localhost".

Thanks,
Codelobster Team.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Sat Mar 30, 2019 2:40 pm 
Offline

Joined: Fri Mar 22, 2019 10:13 pm
Posts: 28
Admin wrote:
Hi.

1) Does the following folder exist on your PC:
/home/your_user_name/.local/share/CodelobsterIDE
?

2) Does in contain wptmp.zip ?

3) Please, try to set the following values:

Location: /opt/lampp/htdocs/
Project name: xxxxx

4) Please, check "URL for the project" in the Advanced section.
It should be something like "http://localhost/xxxxx"

5) Please, check "Database Host".
May be it should be 127.0.0.1 instead of "localhost".

Thanks,
Codelobster Team.



Hi there
Thanks for your help.

Point 2 yes there is.

The project cannot be created in lampp due to a permision I think.
I have to find a way to give codelobster rights in opt.

So I changed the project folder to username/sites/projectfolder
and got the same message.

Cannot create WordPress project because error:
Critical error: Cannot download wordpress

The URL says: "http://localhost//xxxxx
and changed to "http://localhost/xxxxx it still has the same outcome.

Does odelobster try to download WP? Why if it is already in .local/share/codelobster?

thx

P.D. last try with changed permisions and codelobster is in the 2nd hour not finishing the project's intake.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Sun Mar 31, 2019 6:13 am 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi.

Are You able to provide us with access to your PC via TeamViewer?
We will look at the problem.

Many thanks,
Codelobster Team.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Mon Apr 01, 2019 1:55 pm 
Offline

Joined: Fri Mar 22, 2019 10:13 pm
Posts: 28
Admin wrote:
Hi.

Are You able to provide us with access to your PC via TeamViewer?
We will look at the problem.

Many thanks,
Codelobster Team.



Not really
1rst I'm on Linux, to install teamviewer there is a lot to do to make it work.
Easier is just telling me what to do.

Give me a sample how to set up the WP Wizzard,
we believe it could well be our configuration as the same problems (error messages) pop up on Windows.

Our questions are:
Do I have to create a folder with files or without?
Do I have to have a MySQL Database ready? Username with privileges set up (which we have)
Does the database have to have the name wp? (we tried both ways no luck)
Which spaces we leave blank?

In setting for debugger I get a Web server not found.

BR

The same Error message on Linux and Windows:
Cannot create WordPress project because error:
Critical error: Cannot execute installation script
Check you project url

That means we have gone past the MySql part.

Where can I adjust the proper path for the existent WP zip file?
/home/your_user_name/.local/share/CodelobsterIDE

funny is that the wp zipfile is absent.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Tue Apr 02, 2019 2:11 pm 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi.

What is the value of your virtual folder?
It should be something like this (without project name):

/opt/lampp/htdocs

And did You try "Database Host"=127.0.0.1 instead of "localhost"?

Thanks,
Codelobster Team.


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Thu Apr 04, 2019 7:10 pm 
Offline

Joined: Fri Mar 22, 2019 10:13 pm
Posts: 28
Admin wrote:
Hi.

What is the value of your virtual folder?
It should be something like this (without project name):

/opt/lampp/htdocs

And did You try "Database Host"=127.0.0.1 instead of "localhost"?

Thanks,
Codelobster Team.


Hi there
/opt/lampp/htdocs yes permision set to 777
I also tried it with a user folder like docs/sites/project, same result.
I changed Database Host"=127.0.0.1 to 127.0.0.1
We did it in Linux and in windows and get the same error message (Cannot download wordpress)

In linux we placed the wptmp.zip into the opt/lampp/htdocs/project folder with the same result: error message (Cannot download wordpress)

So tell me
Do we have to create a folder with files or without?
Do we have to have a MySQL Database ready? Username with privileges set up (which we have)
Does the database have to have the name wp? (we tried both ways no luck)
Which spaces we leave blank?

Wordpress does not work with Windows nor in Linux, suspecting a misleading path


Top
 Profile  
 
 Post subject: Re: Why is my template not recognizig my scripts?
PostPosted: Fri Apr 05, 2019 8:30 am 
Offline
Site Admin

Joined: Wed Sep 12, 2007 2:18 pm
Posts: 3467
Hi.

Let's try to resolve one problem at first.
You describe several errors.

1) Do You use Linux or Windows OS?

2) Do You try to install CakePHP or Wordpress?

3) What error do You get:
Code:
Cannot create CakePHP project because error:
Critical error: Setup CakePHP error

or
Code:
Cannot download wordpress

They are different problems.

4) What are your last values while project creating?
"Virtual folder" should be without project folder.
And, please, try to enter some new project name.

5) Windows setting should be something like:
Virtual folder C:\xampp\htdocs
Project name xxxx
URL for project http://localhost/xxxx/

Thanks,
Codelobster Team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2016 phpBB Group