Blog Posts not showing title
Remove the <!– –> in <!–<h1><?php the_title(); ?></h1>–> these are html comments so it won’t get displayed.
Remove the <!– –> in <!–<h1><?php the_title(); ?></h1>–> these are html comments so it won’t get displayed.
This depends 100% on how you’re getting the title. If you’re using a global object (i.e. $post->post_title then you’re not passing it through any filters and you’ll have to use some fancy post-processing to pare the title down. However, if you’re inside a post loop, use either the_title() to echo the current post’s title or … Read more
Use mb_strlen(), not strlen(). The same with mb_substr() and substr(): Your title contains multi-byte characters, but strlen() and substr() do not work on characters, they work on single bytes. For a improved function to shorten strings see this answer.
WordPress does not require entering post titles, at least not in the backend. You can leave that part of the form blank. As far as your theme is concerned, that will depend on the theme author and whether they’ve considered someone not entering a title. The default twentyeleven theme handles it fine, linking to the … Read more
If you are using that code by Rev Voodoo, you will need to edit that code, not try to hook into WordPress core code. The form in that link submits to itself, and handles its own post processing thus bypassing many core hooks. Some of the hooks you are trying to use aren’t going to … Read more
You have to loop through that part of the code to get more posts: $args = array( ‘posts_per_page’ => -1 ); $the_query = new WP_Query( $args ); <?php if ($the_query->have_posts()) : ?> <?php while ($the_query->have_posts()) : $the_query->the_post(); ?> …<your code>… <?php endwhile; ?> <?php endif; ?>
If your theme is using add_theme_support(‘title-tag’), then you can try the following: remove_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 ); and then just hook in your own modified version: add_action( ‘wp_head’, ‘wpse_render_title_tag_with_itemprop’, 1 ); function wpse_render_title_tag_with_itemprop() { if ( did_action( ‘wp_head’ ) || doing_action( ‘wp_head’ ) ) { printf( ‘<title itemprop=”name”>%s</title>’ . PHP_EOL, wp_title( ‘|’, false, ‘right’ ) ); … Read more
to show the page title for the page set as the ‘blog’ or ‘posts page’, you need to add some code, maybe via a filter on wp_title(); example: add_filter( ‘wp_title’, ‘wpse_174379_show_posts_page_wp_title’ ); function wpse_174379_show_posts_page_wp_title( $title ) { if( get_option( ‘page_for_posts’ ) ) { $posts_page = get_post( get_option( ‘page_for_posts’) ); $title=” ” . $posts_page->post_title . ‘ … Read more
when you upload image to WordPress you must to fill Title field. and also your theme must use default WordPress thumbnail function.
I’m not sure where this php_browser_info() function comes from. You can try the following instead: /** * Modify the front/home page title for Android devices */ add_filter( ‘wp_title’, function( $title ) { return ( is_front_page() || is_home() ) && isset( $_SERVER[‘HTTP_USER_AGENT’] ) && false !== stripos( $_SERVER[‘HTTP_USER_AGENT’], ‘android’ ) ? ‘Test Android’ : $title; }, PHP_INT_MAX … Read more