Questions tagged [formatting]
The formatting tag has no usage guidance.
183
questions
0
votes
1answer
24 views
How can I change the date format of the revision list?
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');&...
0
votes
0answers
11 views
Wordpress API getPosts gives numerical HTML Code
I´m using the REST API from Wordpress to get Posts. Unfortunately there are some characters, which come in numerical HTML Code, like here in the title.
GET https:///wp-json/wp/v2/posts
{
"id&...
1
vote
1answer
37 views
Wordpress | Convert #038; to &
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 #...
0
votes
0answers
62 views
“Aside” block in Gutenberg
Is there a Gutenberg block that produces a layout akin to what is displayed in the below screenshot? In HTML, a layout like this would normally be implemented with the <aside> tag.
0
votes
1answer
71 views
How to do store, retrieve and write attributes in the registerFormatType method in Guttenberg?
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 ...
1
vote
1answer
25 views
Number format for wp_count_posts()
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 ...
0
votes
2answers
29 views
Measure time in ONLY HOUR format
I need to change the timeformat in this column
to be in hours, not measured in seconds and minutes. This meaning that 30 minutes should be measured in 0.5 hours and so on.
I think I need to edit this ...
0
votes
1answer
87 views
WooCommerce product title formatting
What is the best way to format my product titles?
I would like the brand of the product to be on it’s own line in a larger bolder font and then underneath the name of the products in a smaller more ...
0
votes
0answers
29 views
Problems with cart and pages on _s theme
I recently took over managing this website Berman Instruments, one of our clients. They claim that it the cart was working until June. This is a 2 part problem.
In this scenario, an unregistered user ...
0
votes
1answer
139 views
Is there an easy way to remove the data-preserver-spaces span from blocks?
I converted a page from Classic to Guttenberg and now all the blocks have this span in them:
<p><span data-preserver-spaces="true">...</span></p>
This means that all ...
1
vote
1answer
301 views
How to preserve exact formatting when copy pasting from Facebook into WordPress (or elsewhere)?
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 + ...
0
votes
0answers
72 views
How to make “formats” dropdown styles apply to only the selected text?
How can I make the format styles dropdown in the classic editor apply to ONLY the selected text? Right now it is applying to the nearest line break from the selected text, I don't like that.
Here is ...
1
vote
0answers
64 views
Force Balance Tags not working
I am trying to shorten my the_content() word count to 200 while retaining the html formatting as well as the shortcodes. I am pretty close but for some reason, I cannot get force balance tags or ...
1
vote
0answers
34 views
Remove add to cart icon/view product button woocommerce
I'm trying to remove a button that appears when hovering over the images on a woocommerce shop. (See images attached)
The product is a variable product.
Failing being able to do this I also tried to ...
1
vote
1answer
75 views
What are the “U” and “G” time formats?
In WordPress time functions, such as get_post_time(), one can pass a couple of formats that I do not understand what they do. Those are U and G. What are those exactly? Documentation is pretty vague.
...
0
votes
0answers
21 views
Preparing Hardcopy and Online Page
I am writing a book and I want to post it online (into various web pages) and also want to have a hardcopy. The book has a lot of figures and math equations. How can I prepare the posts to minimize ...
0
votes
2answers
94 views
Mystery line break
I have a coding noob question if someone wouldn't mind taking a squiz. Trying to get the title placed on the same line as the label, i.e
Label: Title
Currently it's formatted as:
Label:
...
0
votes
1answer
80 views
get_the_term_list( get_the_ID() label formatting?
is it possible to change the style of the "label" of the result of a get_the_term_list( get_the_ID() ?
$film_tags = get_the_term_list( get_the_ID(), 'film_tags', 'Tags: ', ', ', '' );
is there a ...
3
votes
0answers
270 views
Why is this gutenberg custom format button only available from the toolbar as a dropdown?
I have a very simple custom format button for Gutenberg. JS code is as follows:
(function ( wp ) {
// Create our button.
var lqdNotesButton = function( props ) {
return wp.element....
0
votes
1answer
27 views
WordPress removes paragraphs. How to disable this behavior?
For example, this code:
<div><p>Some text here</p></div>
Becomes formatted as this:
<div>Some text here</div>
I think that this is MCE related behavior, because ...
0
votes
1answer
18 views
Changing Date Format on Custom Meta Data w/shortcode call
I am currently pulling a date from a users meta and making it so I can input a shortcode and it will show that date in certain places. I have the following code written and it works great!
function ...
1
vote
0answers
147 views
Need to add trailing slash to all internal links relative and absolute
i need to rewrite the url path of my href internal links. I got into my site relative and absolute links.
ex.
<a href="https://www.sitename.com/pippo"
<a href="/pippo"
<a href="/pippo/"
I ...
1
vote
0answers
14 views
Page formatting lost when I attempt a revision
This may be a duplicate post (Lost formatting after saving), but it doesn't seem like it was properly answered...
I have the most recent version of Wordpress (v 5.2.2) and just created a page (using ...
0
votes
0answers
340 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
25 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
1answer
1k 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
41 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 ...
4
votes
4answers
9k 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 ...
3
votes
2answers
3k 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
48 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
42 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
1answer
21 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 ...
1
vote
1answer
4k 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
156 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
24 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
72 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
271 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
130 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
38 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
548 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
775 views
Function sanitize_title() does not appear to be working
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 where possible.
<?php
phpinfo();
...
1
vote
3answers
235 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
1k 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
300 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
289 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
323 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
1k views
Problem in wordpress with “-”
I have problem in Wordpress after migrating my website.
In title tag (<title>) I have
"–"
instead of
"-"
For the browser it's good, in the title it shows good.
But in html code is "&...
0
votes
0answers
25 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
119 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
264 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 ...