Array to modify post titles

Your example code could easily be converted to an array, like this: Updated and improved code for your new example: function manipulate_post_title( $title, $post_id ) { $title_array = array( ‘1153’ => $title . ‘-suffix’, ‘2’ => ‘prefix-‘ . $title, ‘3’ => ‘completely different title’, ); if ( is_single() && isset( $title_array[ $post_id ] ) ) … Read more

Show post title words one by one [closed]

Create a function in functions.php to see if your title part is in an array of ‘banned’ words: function check_word( $word ) { $blacklist = array(‘the’, ‘it’, ‘and’, …); if ( !in_array( $word, $blacklist ) && strlen( $word ) > 3 ) { return $word; } else { return ”; } } Run your title … Read more

Need help with page title (Static front page)

The conditional tag is_front_page() is used to specifically check for a static front page, so you should be able to use that to switch between your title formats <title> <?php if(is_front_page()) { bloginfo(‘name’); } else { wp_title( ‘|’, true, ‘right’ ); }; ?> </title>

Wp Admin Bar Customizing Labels

Don’t use add_filter with the_content that way; that is meant for a different context – when you are filtering a returned WP post object. Try something like this instead: function replace_customer_area_title( $wp_admin_bar ) { $newtitle = __(‘Custom Title’, ‘cuar’); $wp_admin_bar->add_node( array( ‘id’ => ‘customer-area’, ‘title’ => $newtitle, ) ); } add_filter( ‘admin_bar_menu’, ‘replace_customer_area_title’ , 33 … Read more

How to disable publish button if post title exists

This is something you could always do with the help of jQuery Ajax, and get_page_by_title(‘About’, OBJECT, ‘post’) tool. You basically listen to changes on the title field, check if at least 1 post already exists with same title, then enable the submit button if it doesn’t, otherwise keep it disabled as it is by default … Read more

Modify link options when hovering over post title

If you want to just hide the link in the admin area, you can add this CSS code to your admin area. Assuming that the extra link is the LAST one in the row, add this code to you theme’s functions.php file: add_action(‘admin_head’, ‘my_custom_fonts’); function my_custom_fonts() { echo ‘<style>.row-actions span:last-child {display:none} </style>’; This will hide … Read more

Front page displays different than all other pages?

I’m not very sure how is your title on other pages, but here is how you can modify your title: <?php wp_title( ‘|’, true, ‘right’ ); ?> This will show your Blog’s name right to your page’s title, which will have seo benefits. The | separator will be used here. If you want to customize … Read more

How to give titles to custom post type as “unique” incremental number?

The method for increment you used will not achieve what you want to if you delete the posts. Instead you can save the counter in wp_options table on front-end form submission, something like: if(get_option(‘customers_count’)){ $count = get_option(‘customers_count’, true); update_option(‘customers_count’, $count+1); } else { /** This will automatically add the option if it does not exist. … Read more