get content of author page
get content of author page
get content of author page
try wp update post function: // Update post 37 for example $my_post = array( ‘ID’ => 37, ‘post_title’ => ‘This is the post title.’, ‘post_content’ => ‘This is the updated content.’, ); // Update the post into the database wp_update_post( $my_post ); https://codex.wordpress.org/Function_Reference/wp_update_post
You need to edit your theme’s CSS to do this. In style.css in your 2014 folder on line 1021: .site-content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content .entry-meta, .page-content { margin: 0 auto; max-width: 474px; } change 474px to whatever you want your content width to go up to. Or set it to 100% to stay … Read more
Get First paragraph only (from page)
first workaround: Edit the page under wordpress classic editor and copy (ctrl-C) the whole to the clipboard. Open the vim editor Copy (ctrl-V) the clipboard to the vim window Replace all control characters with a space :%s/[^@-^M]/ /g (ie ctrl-V ctrl- @ and ctrl-V ctrl-M) Overwrite the page content in wordpress with the new … Read more
Just check the raw post content without any filters: if ( “” === $post->post_content ) { the_post_thumbnail(); } else { the_content(); }
The following will allow you to limit content to any word count you like based upon whether the user is part of a certain user role or not. The function can be improved and or made more efficient but at least it provides you the basis for filtering your content without having to physically edit … Read more
WordPress 5.0+ has a function for this: parse_blocks(). To see if the first block in the post is the Heading block, you’d do this: $post = get_post(); if ( has_blocks( $post->post_content ) ) { $blocks = parse_blocks( $post->post_content ); if ( $blocks[0][‘blockName’] === ‘core/heading’ ) { } }