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

Custom fields won’t display on my blog page

Try using: <?php // Determine context $page_id = ( ‘page’ == get_option( ‘show_on_front’ ) ? get_option( ‘page_for_posts’ ) : get_the_ID ); // Echo post meta for $page_id echo get_post_meta( $page_id, ‘Page Description’, true ); ?> What’s happening: You’re using a static page as front page, and a static page to display the blog posts index … Read more

Sort category page with custom field

I added the query_posts so we can tell WordPress of a modified query to run. $query_string will let us add onto the current parameters. orderby, meta_key, order let us define the query by telling it how to sort the results More information on ordering by parameters <?php wp_reset_query(); ?> <div id=”content”> <div id=”postFuncs”> <div id=”funcStyler”><a … Read more

Show User Their Password

Theoretically, this could be achieved by saving a user’s password elsewhere, when he or she updates it. Note that this sort of thing is hardly ever recommendable. In almost all cases, there is a better architectural approach that renders having to be able to show plain-text passwords unnecessary. That being said, if you absolutely must … Read more

Populating meta box with select-list of existing posts, and assigning it to custom post types

I believe this is what you were looking for. I moved back to using a class because what you were using would very easily conflict with someone else’s code who decided to use the function names select_box_add_meta_box(), select_box_content() and/or select_box_save_postdata(), which is reasonably likely. The class name WPSE_85107 is only likely to conflict with somebody … Read more

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