dsb0328
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Add Javascript?One more quick question. Should I put these files in my child theme folder or the original theme folder? Or should I overwrite the functions.php file, with the added code, in the original them folder and add a js/clientlogin.js folder and file to that folder as well?
Probably going to continue in the morning, so no rush tonight. Again, thanks so much. You guys have been GREAT!
Forum: Fixing WordPress
In reply to: Add Javascript?Both posts actually, Red Deer. Again, sorry.
Forum: Fixing WordPress
In reply to: Add Javascript?Sorry Red Deer, I didn’t see your post. It must have come in while I was typing mine. Thank you all for the tremendous help. I am going to try it out and I’ll let you know if it works. Thank you. Thank you. Thank you.
Forum: Fixing WordPress
In reply to: Add Javascript?Thanks tymax. But I’m still confused. I think I’m going to have to do a lot more research on this, because I think I’m getting more confused as I go. Unless someone can assist me in where I put the “Hook” code and where I put the Javascript from the original website source code. I like to think that I’m okay in html and css, but when it comes to Javascript, I kinda fall all over myself.
Forum: Fixing WordPress
In reply to: Add Javascript?Thanks for the quick reply briansteeleca! I may be a little confused as there are so many different instructions on that page. Here’s the code that I want to include in WordPress (altered with “example.js” and “example.com”. Also, not sure if I need the first <script LANGUAGE…> line.):
<script LANGUAGE=”JavaScript” SRC=”include/example.js”></script>
<script Language=”JavaScript”>
function validateemail(sEmailAdd){
if (sEmailAdd == “”)
{
alert(“Please enter your email address and try again.”);
document.frmLogin.txtusername.focus();return false;
}
else
{
return true;
//var sFeatures = “top=” + ((screen.height / 2) – 300) + “,left=” + ((screen.width / 2) – 400) + “,height=550,width=750,status=yes,toolbar=yes,location=yes,resizable=yes,directories=no,scrollbars=yes”;
//window.open(“http://www.example.com/timetrax/content/fmeTimeTrax.asp?Email=” + sEmailAdd,””,sFeatures);
}
}function CheckFields(frm) {
if (frm.txtusername.value == “”) {
alert(“Please enter your email address and try again.”);
return false;
}return true;
}</script>
Should I use this method in my Child Theme? If so, do I create a new file in my child theme folder?:
Load a Script from a Child Theme without Dependencies
Register and enqueue the script in the same callback function with no dependencies, in the footer. See wp_register_script() for details. In this example, google_analytics_object.js is the Google Analytics tracking code (provided by Google) in a file.
<?php
add_action( ‘wp_enqueue_scripts’, ‘child_add_scripts’ );/**
* Register and enqueue a script that does not depend on a JavaScript library.
*/
function child_add_scripts() {
wp_register_script(
‘google-analytics’,
get_stylesheet_directory_uri() . ‘/google_analytics_object.js’,
false,
‘1.0’,
true
);wp_enqueue_script( ‘google-analytics’ );
}Or maybe use this? Also, where would I put it for my child theme?:
Using a Hook
Scripts and styles from a single action hook
/**
* Proper way to enqueue scripts and styles
*/
function theme_name_scripts() {
wp_enqueue_style( ‘style-name’, get_stylesheet_uri() );
wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, true );
}add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ );
Forum: Fixing WordPress
In reply to: Add Javascript?Just t o be clear, I built a new site in WordPress to replace an existing site that was built in html. I got the code for the client login form (email and password and buttons) from the existing html and I need to put the Javascript that makes it work, from the head of the original site, somewhere in the WordPress site.
Forum: Fixing WordPress
In reply to: Customer Login Form…Okay, so finally getting back to this. I figured out a way to take the code from the existing form and use it to build the actual form part of this in the Text area of the main content instead of the Visual area. Without using a plugin, which I like.
Now I want to take the JavaScript that it needs from the original site’s source code and somehow put it in the head of my child theme. Is there a good way to go about doing this? Can I just make a new header.php file for the child theme and paste the code in between <head> </head> ? Basically like making a new style.css file in the child? Or is there a better way?
Forum: Fixing WordPress
In reply to: Customer Login Form…Anyone?
Forum: Fixing WordPress
In reply to: Slot Machine Image Header…Haven’t seen a reply yet, so I was just responding myself to see if anyone has an idea how to do this. Any help would be greatly appreciated.
Forum: Fixing WordPress
In reply to: Customer Login Form…Well, for some reason I can’t get the Nice Login Widget to work. Maybe it’s not compatible with the new version of WordPress or maybe it’s just too hard to figure out.
Anyone else have any other ideas? I’m getting desperate.
Has anyone ever used the User Meta plugin?
https://wordpress.org/plugins/user-meta/
Or is this just a plugin to help you log into the WordPress dashboard?Forum: Fixing WordPress
In reply to: Customer Login Form…Sounds like an idea. And I can definitely change the CSS, so that’s not an issue. Haven’t looked too closely at the plugin yet but hopefully I can use the existing header code to point the buttons to where they need to go. I actually looked all over for a plugin like this and never saw this one. Just plugins to help customize the wp user login page. I’ll let you know what happens. And any other suggestions about this are more than welcome. Thanks a ton so far!
Forum: Fixing WordPress
In reply to: Customer Login Form…Here’s the link to the existing form.
http://www.integra-group.com/login.aspx
And they want it to look very similar.
As for the plugin, I may just have to go with that if I can’t figure out another way. Thanks for the link.