When I put -- into a post it is automatically converted to the – – character in the output by wordpress. How can I get normal '--' double dashes in my content.
Last question, I am supplying the Description of my plugin see the part of this called "Customizing the Plugin Information Box", and I can't get any HTML format to work. It just prints off like normal text. Wondering how to get formatting in this?
How can I copy and paste comment threads (and sometimes the original post) from Facebook into WordPress (or elsewhere) and preserve exact formatting? Screenshot? ok, but text etc is better. Both + link would be ideal. When I paste now, the thread/paragraph structure is intact, but the "likes" etc and profile pic thumbnails don't display. I don't need my whole page/site to look like Facebook, just the content of some pasted posts. Ideally a screenshot would be displayed as a …
I have done an excessive amount of googling and haven't found exactly what I need yet. The client uses the editor (WYSIWYG) to create posts. She adds photos, links to external photos, videos, embeds external videos, and all other formatting. But she does not use the tag nor the excerpt field. When I use wp_trim_words() I get mixed results. Posts with local videos leak markup onto the page A couple posts are only images so there isn't any content at …
Hi there I want to disable automatic formatting of table/td/tr widths and heights in WordPress TinyMCE. I create the table, literally type the data in (not copying it from word or anything like that) and it adds in width and heights to my table cells. Then I copy the code into a text editor and remove the widths and heights, then paste it back in and it adds the widths and heights again. Its giving me a headache. The table …
I have worked on this website for as many years as it has been live, and have edited and relayed out sections of it without ever an issue. Until last year. The site is built on Divi theme. The site has multiple admins for different reasons. I can see that there is a lot of custom code that has been added to the additional CSS panel by another of the sites admins, presumably to force their work to sit how …
Let say I want to insert different inline formatting texts. I can do that by opening the HTML mode, but is there a way to do it directly in the visual mode? For example, if I type span.a in a paragraph block then it will insert <span class="a"></span> in HTML, similarly how the formatting buttons like bold or italic do. Or perhaps at least a hotkey button to apply custom formatting, like Ctrl+B. Is that possible? Or to take it …
I've got a post format of Image, and I am running into an issue where the image is being wrapped by a <p> tag. I want to get rid of that tag (specifically on the single.php version) of those post types. How can I get inside the formatting in a theme and remove the <p> tags, or create any format that I want for the output of this type of post, without affecting posts of a different post format?
Pre-formatted text in the Visual Editor is not behaving like I'm used to. I've got an old installation (3.2.1), and when create pre-formatted text, all the line-breaks and spacing is preserved. In the latest version (3.3.1), the line breaks are interpreted as new paragraphs, and the code is broken across those paragraphs, leading spaces removed. Process: Copy code from text editor. Click on the "New Post" link. Choose "Preformatted" from the format menu. Paste (ctrl-v). 3.2.1 - Correctly formatted code …
I am pasting this url: <a href="#" id="event_inquiryToggle">TEST</a> into WordPress Custom Link menu item. When I hit save it saves it as such: http://a%20href=#%20id=event_inquiryToggleTEST/a As such it breaks the link. Thoughts on what I need to add to WP to remove such functionality without having to use a third party plugin?
I've been looking around for a solution that will allow me to edit HTML code and have it remain after a switch to the Visual editor and back. I've tried a bunch of things with no luck: the wp-no-format plugin the Raw HTML plugin entering all my HTML on one line If it were just me managing the content, I would disable the Visual editor. But as I have a number of content managers, and pages on which there is …
In the text editor, where you can set headings and other settings, is it possible to add your own styles for clients to use? and even remove the unnecessary ones?
I'm trying to improve my WP theme and plugin development workflow. VS Code is my editor/IDE of choice and I'm pretty with it in general. However, setting up VS Code with debugging, formatting, linting etc. for PHP, js and (s)css for WP ended up in quite a struggle. There are various good tutorials about how to achieve this, i.e. Linting and Formatting in Visual Studio Code for WordPress Setting Up PHP CodeSniffer in Visual Studio Code Sniffer, Linter, Pretty Printer …
Normally, in WordPress, the page title appears in the content area. I'd like to have the page title appear in the header area. It looks like to do that, I'd have to remove it from its current location in the content-page.php and place it in header.php. But content-page.php is called from page.php, which calls the content-page from within a while loop (while ( have_posts() ) : the_post(); ... ) -- so I'd have to move or copy this into the …
The date format looks like this "$ datef = _x ('F j, Y @ H: i: s', 'revision date format');" but I want it to be like this "$ datef = _x ('Y-m-d @ H: i: s', 'revision date format');". I don't want to modify the core of wordpress, is there a way to do it with a hook? This is in wp/wp-includes/post-template.php, the function is called "wp_post_revision_title_expanded".
Is there a setting in WordPress Gutenberg editor to change the font size of the text we type while writing posts? I mean the text size inside the editor itself, not the published text that blog visitors view.
I need to pass a variable inside the permalink that takes me to my custom post, and then execute the $_GET of this variable inside an input of my cf7. The only problem Wordpress encodes the & in #038; I tried to decode the special characters but nothing. Browsing the net, I found on another question here on stackoverflow, the possibility of using: html_entity_decode But if I echo in frontend, it works perfectly, but when I click on the link …
I want to keep the style attribute. $str is just an example, here's my code: $allowed_html = array( 'div' => array( 'title' => array(), 'class' => array(), 'style' => array() ) ); $str = '<div title='Click to continue' style='display:table'>This is a button</div>'; wp_kses($str, $allowed_html ); $str will actually receive a bunch of html tags and attributes from a post. Then from there i want to strip out all tags and attributes leaving out only divs tags and style and title …
I'm trying to add a format that has multiple, independent attributes to a custom <a> tag. The attributes are href= and data-caption= and data-set= while I use custom client side JavaScript to process the data attributes. Here's my shoddy, work in progress code: var el = wp.element.createElement; var components = wp.components; var withSelect = wp.data.withSelect; var ifCondition = wp.compose.ifCondition; var compose = wp.compose.compose; var caption; var setName; wp.richText.registerFormatType( 'test/set-link', { attributes: { url: 'href', caption: 'data-caption', setName: 'data-set', }, title: …
I'm trying to format my post my total post count in the header of my site. I have the number in there but would like it to format with the commas eg 1,500 not 1500. I know this is probably really basic but I'm still learning.. any help would be much appreciated. Cheers functions.php function wpb_total_posts() { $total = wp_count_posts()->publish; echo '' . $total; } Header.php <?php wpb_total_posts(); ?>