Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

editor default content

$
0
0

Replies: 0

I have just updated WordPress after a long time.
I’ve been using a plugin -My Default Post Content– that allowed me to define a default code showed when I started a post. but, with the new editor, it doesn’t work.

to solve that, at theme functions they wrote me a code:

// ===================generating default post content =======================

add_filter( 'default_content', 'my_editor_content' );
function my_editor_content( $content ) {
    $content = '<div><span class="bodytitle">Subtítulo</span></div>

	IMAGEN
	
	<p><span class="credit">créditos</span></p>
	
	Cuerpo<!--more-->
	_
	
	GALERÍA';
    return $content;
}

and using another plugin –Classic Editor– it works. but Classic Editor does not use the more recent editor blocks editor of wordpress.

there what is shows by default is:

Imagen ejemplo

I should need something like that:

instead of:
<!– wp:gallery {«linkTo»:»none»} –>
<figure class=»wp-block-gallery columns-0 is-cropped»><ul class=»blocks-gallery-grid»></figure>
<!– /wp:gallery –>

this:
<div><span class=”bodytitle”>Subtítulo</span></div>
IMAGEN
<p><span class=”credit”>créditos</span></p>
Cuerpo<!–more–>
_
GALERÍA

is there a way to reach that?

  • This topic was modified 10 minutes ago by anafasia.
  • This topic was modified 9 minutes ago by anafasia.
  • This topic was modified 8 minutes ago by anafasia.

Viewing all articles
Browse latest Browse all 59525

Trending Articles