Custom Post Title as search term

If you register the post type with public set to true, the titles will be included automatically. You shouldn’t have to do anything to make this happen. Something as simple as this from the Codex: function codex_custom_init() { $args = array( ‘public’ => true, ‘label’ => ‘Books’ ); register_post_type( ‘book’, $args ); } add_action( ‘init’, … Read more

Is it possible to have different header style blog titles in different categories?

I assume that any post belongs to only one category. Create respective CSS classes, e.g. ‘news-header’ and ‘mindset-header’, and use following code inside the loop: <?php // get post categories $categories = get_the_category(); // get single category $category = $categories[0]; // echo header with category class echo ‘<h2 class=”‘ . $category . ‘-header”>’ . get_the_title() … Read more

How to delete posts which have same title?

The easy way is to look at the URLs of the posts (or the IDs) and determine what ones you’d like to delete. Then go to the all posts page and hover over the title of the post you’d like to delete, then click the red trash button.

How can I change the title of the Home link in the navigation bar?

wp_nav_menu with no arguments and no menus defined in the back end at wp-admin->Appearance->Menus (which sounds like the circumstance you describe) just lists your pages, plus a “Home” link. That is done by calling wp_page_menu, the default callback for wp_nav_menu, which means that under those conditions you can alter that text by hooking to wp_page_menu_args … Read more

How to get all post titles starting with numbers and symbols?

Hook into the posts_where filter and add your condition to the query: add_filter(‘posts_where’, function($where){ global $wpdb; return “{$where} AND {$wpdb->posts}.post_title REGEXP ‘^[0-9\$\@\!\?\%]'”; // add other symbols in the regex above ^ }); Then do your query: $my_query = new WP_Query(…); You may want to remove the filter after you get the results (make it a … Read more

[Plugin leenk.me]modify get_the_title

“I want to modify the get_the_title function” — Do you mean you want to modify WordPress’s get_the_title(), or simply modify what it returns? If the former, I must strongly advise against it. You shouldn’t hack core files in WordPress. If you want to modify what it returns, use the the_title filter.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)