How to get permalink and title from post ID?
<?php if(count($related)) { echo “<div>Read More<ul>”; foreach($related as $id) { echo ‘<li><a href=”‘.get_permalink( $id ).'”>’.get_the_title( $id ).'</a></li>’; } echo “</ul></div>”; } ?>
<?php if(count($related)) { echo “<div>Read More<ul>”; foreach($related as $id) { echo ‘<li><a href=”‘.get_permalink( $id ).'”>’.get_the_title( $id ).'</a></li>’; } echo “</ul></div>”; } ?>
Try with this: <?php echo get_the_title( $ID ); ?>
The WPSEO plugin by Yoast has a filter for the title: ‘wpseo_title’. You’ll need to add something like this: add_filter(‘wpseo_title’, ‘filter_product_wpseo_title’); function filter_product_wpseo_title($title) { if( is_singular( ‘product’) ) { $title = //your code } return $title; } More info at the WordPress SEO API Docs page.
functions.php <?php add_filter( ‘posts_where’, ‘title_like_posts_where’, 10, 2 ); function title_like_posts_where( $where, $wp_query ) { global $wpdb; if ( $post_title_like = $wp_query->get( ‘post_title_like’ ) ) { $where .= ‘ AND ‘ . $wpdb->posts . ‘.post_title LIKE \’%’ . esc_sql( $wpdb->esc_like( $post_title_like ) ) . ‘%\”; } return $where; } ?> Then: $args = array( ‘post_title_like’ => … Read more
If you have the attachment id, you can use get_the_title() $attachment_title = get_the_title($attach_id) http://codex.wordpress.org/Function_Reference/get_the_title
There is no way to customize that string explicitly. But it is passed through translation function and so is easy to filter. Try something like this (don’t forget to change to your post type): add_filter(‘gettext’,’custom_enter_title’); function custom_enter_title( $input ) { global $post_type; if( is_admin() && ‘Enter title here’ == $input && ‘your_post_type’ == $post_type ) … Read more
There is no documentation on it but you could always apply a filter to the_title like this: add_filter(‘the_title’,’some_callback’); function some_callback($data){ global $post; // where $data would be string(#) “current title” // Example: // (you would want to change $post->ID to however you are getting the book order #, // but you can see how it … Read more