Questions tagged [formatting]

The tag has no usage guidance.

0
votes
0answers
55 views

Object of class WP_Error could not be converted to string in /formatting.php

I'm working on a WordPress site with Chinese language which use WP Bakery plugin. I added woocommerce product category short code on home page to show some products from a category It works on a all ...
-1
votes
1answer
17 views

Generating a number based on post ID

I am trying to generate a number that will be 5 digits including the post ID. For example: if post ID is 25, the number will be 00025. So far my codes are below. It's working but is there any better ...
0
votes
0answers
21 views

Paste as plain text but keep the spaces

I use paste_as_text = true to remove all styling from forum posts in the frontend. But this also removes all the leading spaces on each line. Is there a simple way to avoid the latter?
0
votes
1answer
76 views

Remove formatting in rich text with Gutenbergs Block editor

In the classic editor, an option for removing all formatting in a selected text was possible in the visual tab. Is there such a function for Gutenberg? If not, is it planned at some point? What ...
0
votes
1answer
16 views

Images that copy code to clipboard when you click on them

I run a website about a programming language which is very well-integrated with a front-end which adds a lot of styling to the code that cannot be replicated in the browser. For that reason, I publish ...
0
votes
0answers
15 views

Exporting posts from wordpress to medium

I've a blog with a couple of articles, recently I tried exporting those articles to medium (in order to reach a bigger audience). I used the default medium import tool and found the formatting to be ...
1
vote
2answers
2k views

How to change text size of Gutenberg editor

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 ...
0
votes
0answers
16 views

Woocommerce - adding multiple products to a post stacks them vertically not horizontally

Using Woocommerce shortcodes such as [products tag="mugs"] or [products limit="3" columns="3" best_selling="true" ] or even multiple product IDs adds products vertically in posts. I would like them to ...
3
votes
2answers
157 views

How to get year, month and hour in Wordpress?

Here is the code which gives me only day and month. I want to show all: year, month, day, hour and minutes. How can I do this? print '<time class="entry-date updated" datetime="' . esc_attr( ...
1
vote
0answers
35 views

trigger html cleanup for all posts

So i know that wordpress will auto clean / format html within posts / pages automatically when switching back and forth from text to visual: https://stackoverflow.com/questions/9907757/wordpress-...
0
votes
0answers
34 views

How to completely prevent WordPress from destroying/modifying my shortcode outputs?

Here I have written a (pretty safe) shortcode for embedding iFrames in WordPress: add_shortcode( 'r2o_iframe', 'r2o_display_iframe' ); function r2o_display_iframe($atts) { ob_start(); $src ...
0
votes
0answers
83 views

TinyMCE advanced plugin append (not replace) to 'Formats' menu from editor-style.css

I have successfully replaced the 'Formats' menu of TinyMCE advanced plugin by adding editor-styles.css. What I want is to append some styles in the 'Formats' (as neatly categorized in default), not ...
0
votes
1answer
16 views

Page takes on two different formats

I want to show a list generated from two tables. I have a page with a shortcode that loads the information just like I want. The shortcode runs a function called member_list. In this function, I have ...
0
votes
1answer
1k views

$content = $post->post_content; with formating

I'm trying to get formating but with no luck. My code looks like this global $post; $content = $post->post_content; And to output here <div class="tribe-events-single-event-description tribe-...
0
votes
1answer
27 views

How to amend time format of comments, using child-theme?

How to amend (override) the time format of the comments (of the posts and pages), not touching the wordpress initial installation? I use a child theme and if it is possible in any way to do it from ...
0
votes
0answers
23 views

How do I change the content of an element for a theme without losing the styling?

For example the theme I am using has a built in "coin calculator" that displays live prices for cryptocurrencies to fiat. It looks like this: When I go to edit the page the code for this is just a ...
2
votes
1answer
39 views

Get last seen date/time in wordpress get_comments() [closed]

I could get comment_date with a loop. And it shows like 2018-03-19 12:30:06. Here, I just want to get Last seen format. (For instance, 3 min ago , 1 hour ago , 1 day ago , 2 week ago ) How can I ...
0
votes
0answers
240 views

Understanding automatic text formatting in the Wordpress editor

Why does the text editor remove paragraphs and line breaks? Surely maintaining basic formatting such as paragraphs or line breaks is a basic requirement in all CMS systems. It's hard to believe that ...
-3
votes
1answer
37 views

Adding padding above menu

I am not sure why but after I done some editing the menu now has no space from the type of the page. How do I create this ? http://croiativefilms.com
0
votes
1answer
30 views

Let custom text widget use the same font as the theme

On this page, I have created a text widget. I don't know how to match this up with the font on the rest of the site. The theme uses the Playfair Display font. I don't have extensive knowledge of ...
1
vote
1answer
211 views

Keep pasted pre formatted code as it is -with tabs- in visual editor

I need a manual code to my functions php to extend the visual editor from removing tabs when pasting code blocks. I tried this code, found at this site, but it does not work as I want. If I got: ...
0
votes
1answer
418 views

function sanitize_title() does not appear to be working

Spent quite a while trying to figure this out. I've implemented a stop-gap function that mimics what I believe this function is supposed to be doing, but I would like to use the native libs/functions ...
1
vote
3answers
127 views

Inconsistent behavior from number_format

I'm trying to format a number in a table cell with comma separators between thousands. The number is coming from a custom field generated in Advanced Custom Fields plugin, where it is required to be a ...
-2
votes
2answers
486 views

Paste Function Broken

My paste function appears to be broken for my Wordpress site. I have tried on multiple computers, and browsers, and the results are the same: I cannot post anything, whether it be text, an image, or ...
-1
votes
1answer
207 views

Decimal stripped from metabox number

I am working on a Wordpress website for a client to show several property listings and their associated prices. When I enter the number in the metabox created by the developer it strips out all ...
-2
votes
2answers
99 views

Date is showing in unreadable format. How to convert to readable date?

I am using the following code to show the expiration date of my coupon; <?php _e('Expiration Date:','wpestate'); echo esc_html($expiration_date); ?> But, it is showing in following ...
0
votes
2answers
188 views

Paste from word not preserving formatting

When I paste from word, it adding a lot of extra spacing around each block of text. If I look in html editor, it's putting a <strong> </strong> in between each block of text, which makes ...
5
votes
2answers
625 views

Problem in wordpress with “-”

I have problem in Wordpress after migrating my website. In title tag (<title>) I have "&#8211;" instead of "-" For the browser it's good, in the title it shows good. But in html code is "&...
0
votes
0answers
24 views

Post formatting bug in WordPress

I have a Math counterexamples blog. One post contains the string <strong>We now prove that</strong> \begin{align*} However, when that post is displayed without the "Continue reading" ...
0
votes
1answer
73 views

Editing the formatting.php file vs functions.php file?

I'd like to format the time-ago date format from 5 min to 5m. I can edit the formatting.php file and make the edit but should I? Should I instead declare the edit in the functions.php file? From the ...
0
votes
1answer
143 views

Formatting poetry in wordpress

I am (a novice) editing a poetry blog. Poetry has weird spacing, and I can't get any combination of code to do what I need. For example, one poem needs to be single spaced, but it also needs an ...
0
votes
2answers
34 views

My custom theme text and content format

Hi I am new to Wordpress development and I have learned a lot already but I do not understand why the text and content in the pages and posts does not keep the format that the user sets in the back-...
0
votes
1answer
417 views

What's the best way to trim content from WYSIWYG editor?

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 ...
1
vote
1answer
2k views

Disable TinyMCE Table formatting width/height

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) ...
0
votes
1answer
3k views

Trim content without stripping formatting

I've tried <?php $trimmed = wp_trim_words( get_the_content(), 55, "" ); ?> <?php echo $trimmed; ?> and <?php $trimmed = wp_trim_words( the_content(), 55, "" ); ?> <?php echo $...
0
votes
2answers
253 views

How to paste source code from IDE to posts directly?

I have tried preformatted button, Paste as text button or Text tab element before pasting source code, WordPress always stripped indent tabs and broke code formatting. For example, the source code: ...
0
votes
2answers
81 views

Calling PHP Titles inside Javascript Markup

I have a video gallery, and all the titles are generated by php. They are coming from my Wordpress media library's attachment titles. The lightbox for these videos, however, is customized in ...
0
votes
1answer
93 views

WordPress get_the_content losing formatting when emailed

I'm pulling the content of a post outside of the loop to send in an email like so: $content = get_the_content(); However, when I craft the body of the email: $body = 'Hello: <br/><br/>...
-2
votes
1answer
4k views

How to add a spoiler without using shortcode-based plugins [closed]

I read it is advised not to use shortcode-based plugins, so I was wondering about an alternative elegant way to implement spoilers
3
votes
1answer
107 views

Updating to Version 4.5 bumped my “main sidebar” widget out of place

I updated to the newest version of word press and it changed my home screen. Essentially it shifted my text to the right and as a result shifted my "main sidebar" widget downward to now begin below ...
-1
votes
1answer
1k views

How to display html code normally?

I want to display my html code as it write in edited format. Here is my edited html code. It display as following after publishing it. How to make it displayed as the following?
1
vote
0answers
356 views

Visual/Text Editor displays blank pages in WP-Admin- but HTML on client side displays correctly

Theme: Hemingway, Twenty-Sixteen Host: Bluehost Browser(s): Safari, Chrome OS: OSX El Capitan 10.10.5 (14F1605) Website When I try to "Edit Page" visual editor screen is blank, in both Text and ...
0
votes
1answer
590 views

WordPress menu>Custom Link: removing my link formatting and adding %20

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=...
2
votes
1answer
58 views

Why does WP not like my <a> container?

Lately I've been working on some shortcodes where all the elements the shortcode produces are wrapped inside an tag. Unfortunately this is not rendered like wanted, because of the filter wpautop on ...
2
votes
1answer
533 views

Code Blocks with WYSIWYG in blog post

Is it possible to format code in the wysiwyg editor, up to now I use Blockquotes to represent code, but my problem is that it does automatically line breaks, and I don't want to have random line ...
1
vote
0answers
90 views

How to properly format if statement with html and php

I have an if statement that has some html and php in it. The way I have formatted it at them moment seems a bit messy: EDIT <?php $audio_source = get_field( 'audio_source' ); ...
1
vote
1answer
249 views

Selectively remove empty line after line change

In WP post editor, how can I change lines without adding an empty line? I try to post this One line Second line third line But it always shows like this One line Second line Third line PS: I ...
0
votes
0answers
19 views

How to format the various types of custom fields?

So i am ready to throw in my custom post type a bunch of custom fields. All these fields need specific handling for their input and validation. Exmaples: Numeric fields E-mails WYSIWYG editor ...
2
votes
1answer
90 views

Is there a way to disable formatting shortcuts in 4.3?

Since the WordPress 4.3 version was released there are these new things called formatting shortcuts. They can be helpful but I find them mostly annoying. Is there anyway to disable these new ...
-1
votes
1answer
589 views

Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]

I need to show 7 posts of a certain category. The first needs to appear as Title / Date / Excerpt. While the others can just be Titles of the posts. Right now I am having trouble with getting the ...