Replacing the title in admin list table

1. Change post title in post list column I misunderstood what you wanted – obviously. You can do that like this: add_action( ‘admin_head-edit.php’, ‘wpse152971_edit_post_change_title_in_list’ ); function wpse152971_edit_post_change_title_in_list() { add_filter( ‘the_title’, ‘wpse152971_construct_new_title’, 100, 2 ); } function wpse152971_construct_new_title( $title, $id ) { //print_r( $title ); //print_r( $id ); return ‘new’; } Making use of the admin_head-$hook_suffix … Read more

Modifying recent post widget to include icons for post titles

Here’s an example how to prepend a span tag to the post titles, where the span class is added in the custom field wpse_post_icon_class. We could try to restrict it to the Recent Posts widget with: add_filter( ‘widget_display_callback’, function( $instance, $obj, $args ) { // Only target Recent Posts widgets if( ‘recent-posts’ === $obj->id_base ) … Read more

Get post/page title from ID

If you have only ID of a post and you want only the title of that post, then using get_post_field will be best way to do this, I guess. The syntax of this function: get_post_field( $field, $post_id, $context ); So code, that will solve your problem looks like that: $title = get_post_field( ‘post_title’, $POST_ID ); … Read more

Get post title with link

Did you use it like that?? <a href=”https://wordpress.stackexchange.com/questions/141318/<?php get_permalink($id); ?>”><?php the_title($id); ?></a> for use to that foreach($ids as $id){ $link = get_permalink($id); $title = get_the_title($id); $links .= ‘<a href=”‘.$link.'”>’.$title.'</a>’.'<br/>’ ; //$links .= $link . ‘ <br>’; } get_permalink get_the_title Try to use that while I’m coding your code.

How to split up the_title and insert a span tag

its best if you just use custom field type to create a sub title… That way you leave the title un-touched and just add a field where you can insert a value like so (calling field sub title): Then you can fetch your subtitle easily: <?php $sub_title=get_post_meta($post->ID,’subtitle’,true); if($sub_title != ”) { echo ‘<h1>’. the_title() .'<span>’. … Read more