Wordpress Themes

Can WordPress power group/collective blogs?

Many users can register and participate on a WordPress blog. You can even assign them different privileges (“User Levels”), so there can be “administrators” and simple “contributors”. For more information see User Levels.

How To Prevent Page Scroll When Clicking the More Link

By default, clicking the .more-link anchor opens the web document and scrolls the page to section of the document containing the named anchor (#more-000). This section is where writers choose to place the <!--more--> tag within a post type.

Users can prevent the scroll by filtering the_content_more_link with a simple regular expression.

function remove_more_link_scroll( $link ) {
	$link = preg_replace( '|#more-[0-9]+|', '', $link );
	return $link;
}
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );

Simply add the above code to the theme’s functions.php file and the named anchors are no more.

How do I change the “read more” link?

Adding this code to your functions.php file enables you to customize the read more link text.

function modify_read_more_link() {
    return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
}
add_filter( 'the_content_more_link', 'modify_read_more_link' );

Code reference: https://developer.wordpress.org/reference/hooks/the_content_more_link/

How can I do a bulk edit of the Status field for all the posts in my database?

Use the following SQL commands to change the post_status for every post in your wp_posts database table. This command will do the bulk change and exclude Pages from being changed–remember to replace STATUS with draft, private, or publish.

UPDATE wp_posts  SET post_status = 'STATUS' WHERE post_status != 'static';

If you have multiple authors and only want to do a bulk edit of just one author’s post, you can use the following command, but remember to replace NUMBER with the correct ID number of the post_author.

 UPDATE wp_posts SET post_status='STATUS' WHERE post_author='NUMBER';

See also: