I have tried by the using both span and div and please forgive the “;” which is incorrectly placed
I usually hide all pages and publications not owned by the author.
I`m not sure if you are trying to hide post or page but there are plugins for both.
You can try: <a href="https://bg.ww.wp.xz.cn/plugins/hide-singular-title/" target="_blank">Hide Singular Title </a>
——————————————————————————
You can hide both files and published post when you add this to the bottom of functions.php file of your theme. (for files)
/*
* Hide Media Images EDIT
*/
function hide_posts_media_by_other($query) {
global $pagenow;
if( ( 'edit.php' != $pagenow && 'upload.php' != $pagenow ) || !$query->is_admin ){
return $query;
}
if( !current_user_can( 'manage_options' ) ) {
global $user_ID;
$query->set('author', $user_ID );
}
return $query;
}
add_filter('pre_get_posts', 'hide_posts_media_by_other');
/*
* Hide Media Images UPLOAD
*/
add_filter( 'posts_where', 'hide_attachments_wpquery_where' );
function hide_attachments_wpquery_where( $where ){
global $current_user;
if( !current_user_can( 'manage_options' ) ) {
if( is_user_logged_in() ){
if( isset( $_POST['action'] ) ){
// library query
if( $_POST['action'] == 'query-attachments' ){
$where .= ' AND post_author='.$current_user->data->ID;
}
}
}
}
return $where;
}
/*
——–> Use this tutorial to hide all posts:
http://phpbits.net/hide-wordpress-posts-and-media-uploaded-by-other-users/
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
-
This reply was modified 9 years, 2 months ago by
Wordshit.
-
This reply was modified 9 years, 2 months ago by
bcworkz. Reason: code fixed
Oops! I just noticed you are referring to backend display, my original response below was front end oriented. Backend titles are passed through an htmlentities() function so that all characters are displayed despite any added HTML. It would be foolish to disable this because then there would be no way to properly edit titles using the WP UI.
Spans and divs with element style attributes work fine in my very plain installation. It could be your theme or one of your plugins is filtering out HTML or the user who added the title does not have unfiltered HTML capability.
-
This reply was modified 9 years, 2 months ago by
bcworkz. Reason: mis-read post - sorry!