I am trying to remove the TinyMCE menubar below
from wordpress via the theme functions.php. I dont want to edit the core/script files. Is this possible? Removing button options is straight forward, but stripping this bar is proving difficult.
Thanks
Using tinyMCE 4 you can set the following in the tinymce init:
<script type="text/javascript">
tinymce.init({
menubar: false
});
</script>
Apologies. A colleague installed advanced TinyMCE without me knowing, so i thought this was wordpress default. I have removed it from there. Question can be disregarded.
You can disable menubar by adding following code in enqueue in your theme function.php , selector is option you can use without it as well as said by Milap.
<script language="javascript" type="text/javascript">
tinymce.init({
selector: "textarea",
menubar: false
});
</script>
Related
Hi I have been trying to change 1 word of text within the Avada theme.
Here is the line of text: http://prntscr.com/ibac1t
This is on all gallery pages, but here is one page for example: http://preview.geomedia.co.uk/nursteadcourt/our-destination/wedding-5/?portfolioCats=24%2C21%2C23%2C22
I can't seem to find where it is to change, I would like to change the word 'Projects' to either: Pictures or Gallery's. This is probably more complex than I think it will be.
Any assistance in this would be great.
Thanks
You can find this in the file located at
/website_folder/wp-content/themes/Avada/includes/avada-functions.php.
It is in the "avada_render_related_posts" function and at/around line 327.
Copy the file to your child theme folder or else you will have to update this file after every theme update.
Hope this helps.
We use something similar to this:
<script type="text/javascript">
jQuery(document).ready(function() {
/*<![CDATA[*/
jQuery('.related-posts > div > h3').html('Posts Relacionados');
/*]]>*/
});
</script>
Does anyone know how to change the tooltip for the TinyMCE 4.x link buttons:
Thanks
Tooltips are defined when the button is created. For the button in question look in the link plugin code which is in the plugins/link folder within TinyMCE. You can find the addButton code there and change it as needed:
editor.addButton('unlink', {
icon: 'unlink',
tooltip: 'Remove link',
cmd: 'unlink',
stateSelector: 'a[href]'
});
....note that there are both minified and non-minified versions of the plugin code so change both to make sure your changes will work regardless of whether or not you load the minified or non-minified version of TinyMCE.
I want to add some code in my wordpress theme. I've tested it works here: http://jsfiddle.net/UYMxa/250/
I've tried adding it to my wordpress site, by adding custom links in sidebar widget, and js/css in a header/footer plugin but it doesn't work.
I have then replaced $ to jQuery but still no luck?
$('#affiliateLink').click( function () {
$("#fb_pixel").addClass("fb_conversion");
console.log("click");
});
You have to set click handler after the DOM is ready:
jQuery(document).ready(function(){
jQuery('#affiliateLink').click( function () {
jQuery("#fb_pixel").addClass("fb_conversion");
console.log("click");
});
});
And use jQuery instead of $ because you are in noConflict jQuery mode.
You should use $('').on('click', function() {} structure of you code. Then check if you have added jQuery library properly . It might by also some issue with others jQuery functions so try wrap your code into IFFE
https://en.wikipedia.org/wiki/Immediately-invoked_function_expression
I wanna change the href of a specific menu item on all pages. Is this possible? Where should I put the code?
I also added this javascript to the end of a specific page:
<script type="text/javascript">
document.getElementById("menu-item-100").href="xyz.php";
</script>
It didn't work even though when I viewed the page source it showed that the script was placed after the original href of the menu.
I don't wanna use custom links.
Try putting this in your footer.php
<script>
jQuery(document).ready(function($) {
$("#menu-item-100").attr("href", new_href);
});
</script>
Wordpress a lot of the times needs to have jQuery(document).ready(function($) for no-conflict reasons.
Try it, may be helpful to you:
$("#menu-item-100").attr("href", new_href);
Apparently the element with the ID of menu-item-100 had an a tag inside of it; so I had to retarget the whole thing.
This fixed the whole thing.
document.getElementById('menu-item-100').getElementsByTagName('a')[0].href="THE LINK";
Thanks to #NooBskie I put it inside the footer.php and it affected all the pages.
I tried using tinyMCE directly from the package included with:
<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
And then I just set this in my jQuery file:
tinymce.init({
selector: "textarea"
});
Now, for some reason that I can't understand, all my textareas are hidden (visibility:hidden) and nothing else is showing up. I am modifying the DOM in this file with jQuery but I tried to insert a non-modified textarea and still nothing shows up. Is there something with Wordpress that makes this error? I am writing this in the functions.php-file.
Or maybe you should simply use wp_editor() php function
http://codex.wordpress.org/Function_Reference/wp_editor