I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site

I’ve never actually tried this, but I think the following should work: function wpse_96096_append_author( $title, $post_id ) { if( is_feed() ) { $author = get_post_meta( $post_id, ‘{YOUR CUSTOM FIELD KEY}’, true ); $title = $title . ‘ by ‘ . $author; } return $title; } add_filter( ‘the_title’, ‘wpse_96096_append_author’, 10, 2 ); What this does is … Read more

Custom field within shortcode

If you want to put the custom fields inside the shortcode…you actually should put the custom fields inside the shortcode. Be sure that your fields content does not get echoed, according to ACFs resources you have to use get_field($field_name) within the loop. Try: <?php echo print_wp_cart_button_for_product(get_field(‘product_name’), get_field(‘product_price’)); ?>

My Query is getting the wrong data

$the_args = array ( ‘post_type’ => ‘jobs’, the_field(‘job_category’) ); The trouble here is that the_field( ‘job_category’ ) prints data, so using it to build an array is pretty much useless. You’re left with literally post_type = job. However, the real problem is that you actually need to grab the category options, not the posts that … Read more

the_post_thumbnail unless video id is added

I think all you need is this: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> if (get_field(‘channel’) == ‘Youtube’) { echo get_field(‘youtube_video_id’); } elseif (get_field(‘channel’) == ‘Vimeo’) { echo get_field(‘vimeo_video_id’); } elseif ( has_post_thumbnail()) { the_post_thumbnail(); } That should use a Youtube video, then a Vimeo video, then the thumbnail, … Read more

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