Skip to main content
8 votes

How to change text size of Gutenberg editor

If you came here, like me, looking for how to adjust the available text size options within Gutenberg, you can add this code to your theme's functions.php file (you can add as many options as you like)...
Ryan's user avatar
  • 565
4 votes

How to change text size of Gutenberg editor

Just click on the settings/cog icon on the right hand side when you are editing paragraph. Then choose Block. You should then see the option to edit font size. You can choose from dropdown menu or ...
Glenn Greening's user avatar
4 votes
Accepted

$content = $post->post_content; with formating

If i get your question correct, you want the post_content formatted like the content put out by the_content, right? Change your upper code like this: global $post; $content = apply_filters('...
HU is Sebastian's user avatar
4 votes
Accepted

remove <p> tags from the_content

By default, WordPress adds paragraph tags to category descriptions. Stop this by adding the following to your functions.php file // Remove p tags from category description remove_filter('...
Jodyshop's user avatar
  • 196
3 votes
Accepted

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

This is a known issue and will be taken care of soon, assuming you are using the "Twenty Eleven" theme: see this link. The bundled Twenty Eleven theme has some styling issues for pages with sidebars (...
Nathan Powell's user avatar
3 votes

can I add a custom format to the format option in the text panel?

You can add custom format or remove exist in that way: add_filter('tiny_mce_before_init', function($init_array) { $init_array['formats'] = json_encode([ // add new format to formats ...
Vasyl's user avatar
  • 61
2 votes

remove <p> tags from the_content

Simply add below line of code in your theme's functions.php file For content : remove_filter( 'the_content', 'wpautop' ); For excerpt remove_filter( 'the_excerpt', 'wpautop' ); learn more : https:...
Saiful Islam's user avatar
2 votes

Shortcode from a widget is wrapped in unwanted <p> element

This is a known issue since years. Please have a look at Wordpress Ticket. As others maybe mentioned before, there is Plugin to fix this issue. It is called "Shortcode Empty Paragraph Fix". Its not ...
evavienna's user avatar
  • 131
2 votes

Problem in wordpress with "-"

Background: WordPress converts normal dash (-) to long dash (–), straight quotes to curly quotes and some other similar symbols and punctuations to their printer friendly versions using wptexturize. ...
Fayaz's user avatar
  • 8,937
2 votes
Accepted

WordPress get_the_content losing formatting when emailed

The default email content type is text/plain which does not allow using HTML. Add this to your functions.php file: // use HTML instead of plain text add_filter( 'wp_mail_content_type', '...
N00b's user avatar
  • 2,169
2 votes
Accepted

How to add a spoiler without using shortcode-based plugins

There's nothing wrong with shortcode-based plugin if it's well made. To answer your question: there's probably hundreds of ways but this is probably the easiest and most performant (similar to Reddit):...
N00b's user avatar
  • 2,169
2 votes
Accepted

Inconsistent behavior from number_format

Seems like the function you using is the the_field function from of ACF which is a function that outputs a string so the formatting number_formatt dosent effect the output. This code: <?php ...
BenB's user avatar
  • 795
2 votes
Accepted

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

My answer is, there is no solution within the TinyMCE and Wordpress conversation for this. But There are diffrent approaches to work with coding material. I Shared this on an other discussion, but it ...
Jonas Lundman's user avatar
2 votes
Accepted

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

You have to return the formatted date string, the following will work: // define the get_comment_time callback function filter_get_comment_time( $date, $d, $gmt, $translate, $comment ) { $d = "g:...
Pabamato's user avatar
  • 881
2 votes

How to get year, month and hour in Wordpress?

PHP Date Format in WordPress function: You'll have to use the proper date format string (as used in PHP date function) in the WordPress get_the_date() function's first parameter. For example, to get ...
Fayaz's user avatar
  • 8,937
2 votes

Place page title in header?

While above mentioned methods are working for the moment, WordPress core developers recommends as follows: Starting with 4.1 and Twenty Fifteen, the recommended way for themes to display titles ...
Vishwa's user avatar
  • 376
2 votes

How to change text size of Gutenberg editor

When we change the paragraph font size in Gutenberg via the block text settings, it will be added inline like: <p style="font-size:18px">Lorem Ipsum</p> If we are frequently changing the ...
birgire's user avatar
  • 67.4k
2 votes

How to change text size of Gutenberg editor

I had same question how to change heading font size in Editor, just found myself: PS: This is a generic solution for any WP customization: While in editor, using e.g. Firefox "inspect element", ...
Gustaf's user avatar
  • 31
2 votes

Generating a number based on post ID

str_pad is the function you're looking for. echo str_pad( get_the_ID(), 5, "0", STR_PAD_LEFT); This should do the trick.
Krzysiek Dróżdż's user avatar
2 votes

Why is this gutenberg custom format button only available from the toolbar as a dropdown?

Old question but an up-to-date answer could help someone: instead of using RichTextToolbarButton you have to use the BlockControls component. This way your button will appear before the other styling ...
Sicaa's user avatar
  • 21
2 votes
Accepted

What are the "U" and "G" time formats?

The U and G are not WordPress specific. get_post_time() is using the same datetime formats as the default PHP date method. Here is the documentation for all of the formats: https://www.php.net/manual/...
disinfor's user avatar
  • 366
2 votes
Accepted

WooCommerce product title formatting

Add Brand as taxonomy: if ( ! function_exists( 'brand_tax' ) ) { // Register Custom Taxonomy function brand_tax() { $labels = array( 'name' => _x( 'Brands', '...
MMK's user avatar
  • 538
1 vote

Images that copy code to clipboard when you click on them

I think that clipboard.js is your best bet to what you're looking for. Install that script, then just change your img to <img src="..." data-clipboard-text="..."> And you should be good to ...
Paul Elrich's user avatar
1 vote

How to get year, month and hour in Wordpress?

Change this part the_date('F j, Y','G:i') to get_the_date('F j, Y G:i'). WP - Formatting Date
nmr's user avatar
  • 4,511
1 vote
Accepted

Get last seen date/time in wordpress get_comments()

WordPress already have such function in its core. It’s called ‘human_time_diff’ and it’s used in WP admin section. Usage is pretty simple: echo human_time_diff( $from, $to ); where $from is Unix ...
Krzysiek Dróżdż's user avatar
1 vote

Function sanitize_title() does not appear to be working

As you can see in the source code of sanitize_title(), all the function does is 3 things apply the function remove_accents(), supposedly to remove accents apply the filter sanitize_title return ...
kero's user avatar
  • 6,220
1 vote

Paste Function Broken

Can you please try clearing out your cache and cookies using the guide below? http://en.support.wordpress.com/browser-issues/#clear-your-cache-and-cookies Also, please make sure your browser is ...
JItendra Rana's user avatar
1 vote

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

The human_time_diff function applies a filter to the results at the end of the function call. return apply_filters( 'human_time_diff', $since, $diff, $from, $to ); So, use that filter to replace the ...
Otto's user avatar
  • 32.7k
1 vote

Formatting poetry in wordpress

I hope I've understood your question correctly. As you probably gathered, if you are in the visual editor, hitting return creates a new paragraph, but hitting Shift-return creates a line break. A ...
Jonny Perl's user avatar
1 vote

Trim content without stripping formatting

Well, as far I understood you want to remove all the HTML tags from the trimmed the_content. Right??? Try wp_filter_nohtml_kses function. Hope that's going to work. Here is the full code- <?php $...
CodeMascot's user avatar
  • 4,527

Only top scored, non community-wiki answers of a minimum length are eligible