I just started creating WP page with motors theme and it uses WPBakery builder. Now I added one of their STM widget. I can change all text in it but couldn't find how to change 'search' button text. Maybe you have any suggestions?
To edit strings inside of a plugin, there is a very good plugin for that:
https://wordpress.org/plugins/loco-translate/
With Loco Translate you can find strings inside of plugins / themes and edit them. This will work in most cases.
If Loco Translate does not solve your problem (remember to clear your caches), you can also look for the string inside the body of your page and replace it with javascript. Place this code at the end of your page, maybe inside the footer.php of wordpress. If it is not working, try changing "search" to "Search" or "SEARCH", so to make sure the plugin is not using another variant of the string (because of uppercase, you cannot see this). You can also inspect your page with your browser inspector and look what string exactly is inside the button without the css-style of text-transform: uppercase;
This code will replace all occurrences of the string "search".
<script>
document.body.innerHTML = document.body.innerHTML.replace(/search/g, 'your string');
</script>
Another solution would be to change the innerHTML of your button with javascript. This way, you are accessing your button element (i.e. by ID) and then set the content of this element with javascript:
document.getElementById("buttonID").innerHTML = "Text of button";
Related
I am working in Wordpress, and I am using Elementor. Elementor has a native feature for the title of the posts and images to link to the post.
But if I add an excerpt text, it doesn't link to the post. It is not clickable. The read more button does, but not the excerpt of the post.
I am trying to create something like this: greatist.com Every post on their website is clickable - the excerpt, the title, and the image.
My excerpts are really short like on that website, and I would really like them to be clickable. I have absolutely no idea how to do this and I'm beginning to think it's not possible. I am using Hello Elementor theme.
I would deeply appreciate anyone's help. I just registered to ask this question.
You can always try to save text as an photo and make it clickable or make a full section clickable.To do this try to use plugin called "Make Column Clickable Elementor".
Add this code to your website:
const postExcerpts = document.querySelectorAll('.elementor-posts .elementor-post .elementor-post__excerpt');
postExcerpts.forEach(postExcerpt => {
const postUrl = postExcerpt.parentNode.querySelector('.elementor-post__title a').href;
postExcerpt.addEventListener('click', () => {
window.location.href = postUrl;
});
});
This can be added using a script tag. Choose from the following options:
Add this code as a script tag in your functions.php file, to be rendered at the end of the page (wp_footer action hook).
If you have Elementor Pro, use its built-in Custom Code feature to add the code in a script tag to the end of the body tag.
It's recommended to add a pointer cursor so the user will know the excerpt is a link. This can be achieved by adding the following CSS to your style.css file.
.elementor-posts .elementor-post .elementor-post__excerpt {
cursor: pointer;
}
When my client is editing a page on visual editor, they select heading 1 and start typing.
If we switch to text editor is shows the text with the <h1> tags correctly.
This also works fine with <a> links
However if the client selects paragraph and we then check in the text editor it has not picked up at all. Its missing the <p> tags
What could be causing this?
Because <p> tag is the most common and the default, it is not displayed when you switch the editor into Text Mode. If you save the page, display it in your browser (the frontend part visible by the visitors, not the backend) and check its source code (Ctrl + U), you should see the <p></p> correctly used.
In the text editor, a simple new line (\n) produces a <br /> tag. When 2 new lines chars are typed, the current paragraph is closed </p> and a new one is opened <p>.
I was also having the same issue where the content from the visual editor was coming through to the front end but it wouldn't add in any paragraphs. After much searching I came across the solution in that TinyMCE was the cause. I added in the following code to my functions.php and it worked.
function ikreativ_tinymce_fix( $init )
{
// html elements being stripped
$init['extended_valid_elements'] = 'div[*], article[*]';
// don't remove line breaks
$init['remove_linebreaks'] = false;
// convert newline characters to BR
$init['convert_newlines_to_brs'] = true;
// don't remove redundant BR
$init['remove_redundant_brs'] = false;
// pass back to wordpress
return $init;
}
add_filter('tiny_mce_before_init', 'ikreativ_tinymce_fix');
The solution came from https://ikreativ.com/stop-wordpress-removing-html/ but it took me a while to find it so I thought I would repost in here for anyone else having the same issue.
I don't know the method to add tags to the back-end WP text editor, but if you want to show content on a page with added p tags (for example, in a custom PHP-script), you can use in-built wpautop() function.
I'm using a custom button on the TinyMCE editor on my wordpress site to insert a list of urls without having to type the markup. The problem is that TinyMCE automatically removes the urls that do not have a link text. For example, if the custom button is programmed to insert
well, nothing is inserted.
But if I make the button insert
Example.com
it works.
I do not want a link text as I need an image link by using background image sprite instead of by using html img tag.
Is there any way I could prevent tinymce stripping links that have no link text?
Try this:
function myformatTinyMCE($in) {
$in['verify_html']=false;
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
This option enables or disables the element cleanup functionality. If you set this option to false, all element cleanup will be skipped but other cleanup functionality such as URL conversion will still be executed.
I need to add a mailto button to TinyMCE in WordPress. Has anybody already done this? Or any tops on how to go about it?
Given you are wanting to put this into WordPress I assume you want to simply insert a href="mailto:" type tag into your document for the currently selected text.
The simplest way is to create a basic plugin. You can do this in the same page that tinyMCE is initialised into. The example below will wrap the currently selected text with a static mailto.
tinymce.create('tinymce.plugins.MailToPlugin', {
init : function(ed, url) {
ed.addCommand('mceMailTo', function() {
var linkText = ed.selection.getContent({format : 'text'});
var newText = "<a href='mailto:foo#bar.com?subject=testing'>" + linkText + "</a>"
ed.execCommand('mceInsertContent', false, newText);
});
// Register example button
ed.addButton('mailto', {
title : 'MailTo',
cmd : 'mceMailTo',
image : url + '/images/mailto.gif'
});
}
});
// Register plugin with a short name
tinymce.PluginManager.add('mailto', tinymce.plugins.MailToPlugin);
You will of course need to create an image (mailto.gif) for the toolbar button.
You then simply add the following to your plugin list
plugins: '-mailto'
and put mailto on the toolbar.
Of course, if you want to allow the end user to specify the email address and subject, then you will need a dialog. There is a good example of how to create a plugin on the TinyMCE site in Creating a Plugin
Unfortunately I can't comment on how you would do either of these in WordPress but I suspect you will need to customise your version of WordPress tinyMCE plugin.
You can use the class I built in WordPress my tutorial and then make the calls to your javascript files through instantiating the class. At least, regarding the reference to adding it to your plugins.
Cheers
First of all, make sure you have tinyMce Advanced plugin installed. Then, you can just use the insert / edit link button from the tinyMce editor. You don't need a different button. In the destination URL add this
mailto:my-mail#my-domain.com
Wordpress Tiny MCE editor and WP own editor both has button for <blockquote> . if we select any text and press this buttom then it wraps that text with <blockquote>.....</blockquote>.
I want to change this output to this
<blockquote><div class="quote_start"><div></div></div><div class="quote_end"><div></div></div>...................................</blockquote>
How can i do this manually or is there any wordpress plugin which can do the same?
I want to change behaviour of blockquote button in bot editor TinyMCE and WP own html editor?
I'm not sure you can use this to add that many divs but tinymce's valid elements config parameter does allow you to replace tags.
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements
For instance:
tinyMCE.init({
valid_elements : "blockquote/div[class=quote_start]"
});
Would replace all blockquote tags with a div with the quote_start class.
A better way might be to ignore tinymce here and write a filter for the functions.php file of your theme. http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content. Find all the instances of blockquote and replace it with the code you want.
Maybe adding your own button could also be an option?
Some starting point could be this:
http://www.deliciousdays.com/tinymcebuttons/
and/or this:
http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.Editor/addButton
hope it helps? Greetz, t..
If you want the same functionality in two different editors, you're probably better off writing (or looking for) a Wordpress filter that can replace the code. There's this one but it doesn't seem to be able to handle regular expressions (which you would need to replace HTML tags). Maybe this one can do what you need: Text Filter Suite
Getting both TinyMCE and Quicktags requires mods in two places. Here's how to do the Quicktags:
http://website-in-a-weekend.net/extending-wordpress/diy-wordpress-unraveling-quicktags-wordpress-plugins/