query_posts doesn’t order by title

Thanks to Chip Bennett who told me that i’m doing wrong by using query_posts inside content. So i used get_posts and i got what i wanted, thanks! Here is sample of how can you do it, if you got the same problem as me: function some_name(){ global $post; $tmp_post = $post; $args = array( ‘post_type’=>’page’, … Read more

Setting a title on a Custom Post Type that doesn’t support titles

You could add a hidden input into the page to pre-set the title field, because it won’t be on the page(because the type doesn’t support titles). Slug is produced from the title, so you should only need add a title value. Something like this should work(though untested).. add_action( ‘submitpost_box’, ‘hidden_type_title’ ); function hidden_type_title() { global … Read more

Filter the blog title displayed in the header

Remove that filter/function and apply your markup in the PHP template/page file. If you need help post where you output the title. CLASS Here is how I might set this up using a class: if ( ! class_exists( ‘ThemeCustomizations’ ) ) { class ThemeCustomizations { static $inBody = false; public static function set_in_body_true() { static::$inBody … Read more

Custom Post Type with Custom Title

You can try the following code. function custom_post_type_title ( $post_id ) { global $wpdb; if ( get_post_type( $post_id ) == ‘cars’ ) { $engine=”, “.get_post_meta($post_id, ‘Engine’, true).’l’; $terms = wp_get_object_terms($post_id, ‘brand’); $abrand= ‘ ‘.$terms[0]->name; $amodel=” “.$terms[1]->name; $title = $post_id.$abrand.$amodel.$engine; $where = array( ‘ID’ => $post_id ); $wpdb->update( $wpdb->posts, array( ‘post_title’ => $title ), $where ); … Read more

Changing document title only on a custom page template

I think you will want to use the wp_title filter. Add the following to functions.php: function wpse62415_filter_wp_title( $title ) { // Return a custom document title for // the boat details custom page template if ( is_page_template( ‘boatDetails.php’ ) ) { return ‘I\’m the boat details page’; } // Otherwise, don’t modify the document title … Read more

How do I edit the tag without using the deprecated `wp_title()` function?

It looks like _wp_render_title_tag() method is what outputs the tag, and the source code in 4.8 is available here: https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/general-template.php#L1083 You can see: echo ‘<title>’ . wp_get_document_title() . ‘</title>’ . “\n”; You could first remove the action from wp_head: remove_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 ); Then add your own title render method: add_action( ‘wp_head’, ‘_wp_render_title_tag_itemprop’, 1 … Read more

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