I have downloaded a responsive bootstrap website template. It has a lot more extra content and js files that i don't need for my website. I want to remove it along with .js file being used for that content. Is there any plugin or way to find out which js file is being used on which content so that i could make changes accordingly ??
Thanks,
Any help is appreciated...
Have you looked at this question.
I believe you should be able to find out something that should help you in the answer to that question
find unused images, css rules, js script blocks
Related
I'm trying to figure out how to get ANY Javascript to work and where to place the files.
I tried several ways but what is the most logical way? I've been trying for a week, but since I can't find a tutorial on it, I'm going to assume it's embarrassingly easy.
I'm just trying to understand where to put which files before I venture further into this coding journey.
Any help is much much appreciated!
What I've done so far:
I created a Childtheme and added the hook-code to the functions.php file (see image)
There seem to be double code here but I'm not sure
I acquired the files for a .js slider (tried several) but I'm not sure where to put the code/files
The HTML I put in a HTML widget top of page, the CSS I put in Wordpress' 'Additional CSS' and the Javascript I put in the functions.php between the brackets.
I also tried to add the code files in the ChildTheme folder but also didn't work
In wordpress you have no real place for javascript files, that means that you are quite free to place them where u feel beeter.
That said, it is common to have inside your child theme a "js" folder, which could be in the root of the child theme like:
mychildtheme/js or
mychildtheme/assets/js or
mychildtheme/public/js
Once u've picked one of those, all you have to do is this:
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );
function my_custom_scripts(){
wp_enqueue_script('my_custom_script',get_stylesheet_directory_uri()."/[yourpath]/yourfile.js",['jquery','anyotherdeps'],false,true);
}
Which is documented here: https://developer.wordpress.org/reference/functions/wp_enqueue_script/
I am attempting to add a javascript overlay onload, without direct access to the html. I'm only able to upload .js and .css files.
How would I go about doing this, I've searched all over, but as I am no expert at this I'm seeking a simple solution which will allow me to maybe call html and insert it into an overlay, by using javascript only.
I am unsure of the coding of the .js file to contain all of the overlay code and html code combined.
I've been looking at document.getElementById and document.write to do this, am I correct in trying to do it this way?
Any suggestions?
There is no way you can add an overlay to an existing html file without importing the new JS and CSS files in the html file. How ever, if there are other JS files used or imported to the HTML file, edit it and add your code in the JS file. It'll run since the JS file is already imported in the HTML.
I am a very new user of Drupal and want to add this menu to my website. It has the HTML code with a CSS file, two .js files and a few images.
I want to embed this code in a block into my Responsinve blog themed Drupal7 site
I don't even know where to start or end.I tried drupal_add_js but I think I missed something somewhere and reading the forums has got me all the more confused.
In short I need to understand every small point of how and where to make changes to my site folders.
Any help would be highly appreciated.
You dont need to add your js & css in the template file.
When you go into sites/all/themes/your_theme_name
Look for a file that ends with .info
Best practice is to add all of your custom .js & css files there.
All HTML changes will be done in the .tpl template files.
Hope this helps.
The easiest way to do add js is:
Locate your theme folder, usually /themes/your_theme_name or /sites/all/themes/your_theme_name
Look for template.php in it
Look for your_theme_preprocess_html() function - 'your_theme' might be, 'bartik' or 'garland' or your theme name, if not - change it (usually, it's the name of the folder)
add `drupal_add_js('path_to_js') to function
That's it, clear your cache in Admin > Config > Perfomance and check your code
oh, and to add menu block,
Structure > Menu and create new menu or use existant, add menu items
go to Structure > Blocks, find your menu in list and select region for it
p.s.
and, yep, it's not the only way to add js, here you can find at least 7 ways to do it
I´ve tested with several files, and decided to hotlink every single css and js file that I think is needed.
But still the javascript won´t work.
I´ve added 4 files of Twitter´s Bootstrap at: http://jsfiddle.net/PS3LH/
If I paste inside the css area the css required it seems to work, but the css file is already added, so I don´t know why it doesn´t work...
Thanks for your help!
Rosamunda
Make sure you have JQuery loaded first, then tooltip, then popover.
http://jsfiddle.net/QLvUj/
Your bootstrap CSS had the wrong URL too. Above is a working example.
The company I am working with hosts their webpage on Wordpress. They want me to edit some of the code in order to do various things, such as enable a photo container to be a moving slideshow.
Figuring out the javascript and html to achieve the results they desire is not problematic for me. However, I am unsure how to get full access to the Source Code of the site. I have privileged access to the backend of the site but in wordpress when you go to edit it only shows some of the basic html tags while hiding the <div> and <script> tags and code. Is there any way edit the page in its source code format? I don't want to have to go through the simplified and less expressive/less control Wordpress interface, and I don't even know if I can achieve the desired results with it.
If you try and edit individual pages you're approaching the problem in the wrong way. You probably want to be using a plugin or modifying a plug-in to create the slideshow you need. There are many plugins for wordpress that do what you seem to need.
slider-widget is one such pluging
In Wordpress, there are two main parts to the website's front and backend: the core WP files and the theme that is used. (And other important aspect to a WP site is the database, where all content is stored, including text/images entered in the admin backend.)
Core WP files are not to be changed because they get overwritten with each update. What you want to work with is the theme. Look in Appearance>>Themes and see what the active theme is for the site. It will also tell you the name of the folder the theme files are in.
With FTP, go to root/wp-content/themes/your-theme-name. That's the php, html and css source of the displayed part of the site. Uploaded images are in /uploads/, and plugins in /plugins/.
See http://codex.wordpress.org/Theme_Development to get an idea of how themes are built and how to modify them.
See the rest of the docs at WP to see how to work with plugins, add other javascript correctly so it doesn't conflict with WP's included javascripts, etc. All the docs you really need are at wordpress.org