Register a title automatically with a relationship field

If you can grab your data early enough you can do this: function alter_title($t) { return ‘altered-title’; } add_filter(‘pre_post_title’,’alter_title’); add_filter(‘pre_post_name’,’alter_title’); That will change the title and the slug before the post is saved. Of course, you need to work out some logic for that function. As is, it changes all post/page/CPT names and slugs on … Read more

Advanced Custom Fields and date picker, show posts only if the day is today no matter the year

It’s a little complicated, but we can do this by directly modifying the query with a filter on posts_where. We’ll start with a query for posts with a meta value of today’s date, this is assuming a date format of yyyy-mm-dd: $date_today = date(‘Y-m-d’); $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ … Read more

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