I am trying to include script to in individual wordpress individual page, but include script is disabled and can't write into the richtextbox don't know why, check the snapshot attached !
This screen shot is not part of WordPress by default. It's probably part of your theme. The WP way to add js is wp_enqueue_script and for css wp_enqueue_style.
For theme specifics I recommend asking the theme author/support.
Related
I created a cookie banner with some HTML, CSS and Javascript.
My question is how can I add these files within Wordpress to make the banner works on the whole site?
I know I could just use a Wordpress plugin to generate a cookie banner, but I was wondering if it was possible to integrate my code.
Thanks
These are the following methods:
You may use the plugin "Header and Footer" (This plugin have different TABS like html, CSS, JavaScript) and add your whole in this plugin. So Your code work in whole WordPress website.
First, you need to install and activate the SyntaxHighlighter Evolved plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you can go ahead and edit the blog post where you want to display the code.
I really hope someone can help me with this, it is driving me mad and frustrating me. I have installed WooCommerce on an off-line test site on a default theme (TwentyThirteen) and it works and looks great.
When applying it to a theme I have developed however,it works fine. All the woocommerce style has loaded but the woocommerce javascript file is not loaded. I had used some other woocommerce plugin and its js file also not loaded. But when I used TwentyThirteen theme all works fine and all the woocommerce styles and javascript files are loaded but when applying to my theme only style file is loaded
I've tried all the instructions on the WooCommerce website to integrate it to my theme (both methods of either using a catch all page, or adding hooks), and all of this still results.
I had solved the problem. Because of deregister the wordpress jquery and registering the jquery by another handle I think it doesn't load the woocommerce js script. Like
function theme_script(){
wp_deregister_script( 'jquery' );
wp_register_script('jqueryreal',get_stylesheet_directory_uri().'/jquery.js',array(),'4.2');
wp_enqueue_script('jqueryreal');
}
add_action('wp_enqueue_scripts','theme_script');
When I remove the above function from the functions.php ,then problem is solved. All the js element are loaded and works fine as I want .
When I download a jquery ui theme via themeroller I get a jquery-ui-1.10.4.custom.js file instead of the standard jquery-ui-1.10.4.js file that comes with a regular jquery ui download.
I am trying to understand what is changing in jqueryui.js file from theme download to download. I was under the impression that nothing should change the .js file and that themes were just .css. Is this not the case?
I did not apply any customizations to the theme I downloaded (starter theme) and then added just the .css to a page with the regular jqueryui linked up and the page didn't work. When I tried with other themes though such as the hot-sneaks I did not have this problem.
I am asking this question because I would like to link to the jqueryui on a cdn and I just want to use the vanilla version. Is this possible?
Thank you for your help.
I don't think there is anything different other than the name. You could try running them though a compare tool to see if there are any differences.
Here is an online Comparer http://www.diffnow.com/
Here is my issue: I have an HTML template that has CSS, JS and some IMAGES attached to it. I converted it to a wordpress theme by following the very basic and simple instructions here: http://thethemefoundry.com/blog/html-wordpress/ . In order for the images to show, I have to upload them to the WP library and then change the links in the index.php and other files so they point not to /img/picture.jpg, but to www.sitename.com/wp-uploads/2012/11/picture.jpg.
When I do that, the pictures show just fine. However, I then try to upload the JS files to the library as well. That goes OK. Then I go and replace the links to them in the header.php file with the links that now point to the site. Just like above. However, the JS isn't responsing at all.
Can you give me any tips on what I migth be doing wrong? I already went through all the files to see if I haven't missed a link, but everything seems fine.
Thank you very much in advance
Your JavaScript and CSS files should not go in the Media Uploader, they should be included in your theme. From there, you can enqueue them to be included in your header using wp_enqueue_script - http://codex.wordpress.org/Function_Reference/wp_enqueue_script - and wp_enqueue_style - http://codex.wordpress.org/Function_Reference/wp_enqueue_style.
The proper way to determine the page is to use the get_template_directory_uri() function.
For example if you want to register /wp-content/themes/YOUR_THEME/js/script.js and it relies on jQuery you would use this in your theme's functions.php:
wp_enqueue_script('script_name', get_template_directory_uri()."/js/script.js" ,'jquery',false,true);
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