Pass custom value to custom taxonomy

have you tried building your tag array into a variable and passing that as a parameter to set_post_terms? function add_author_taxonomy( $post_id ) { global $wpdb; if(!wp_is_post_revision($post_ID)) { $my_tags = get_post_meta($post_id, ‘user_submit_customauthor’, true); wp_set_post_terms( $post_id, $my_tags, ‘author’, true ); } } add_action(‘publish_page’, ‘add_author_taxonomy’); add_action(‘publish_post’, ‘add_author_taxonomy’) ;

How to display thumbnail if post is assigned one otherwise not

you just need to clean up the if statement: <?php if ( has_post_thumbnail() ) { ?> <div class=”col-md-3″> <?php the_post_thumbnail(); ?> </div> <?php } ?> here’s the whole bit cleaned up: <?php query_posts(‘posts_per_page=1’) ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”jumbotron”> <?php if ( has_post_thumbnail(); { )?> <div class=”col-md-3″> <?php the_post_thumbnail(); ?> … Read more

Easier URL to an image

This should do the job: <img src=”https://wordpress.stackexchange.com/questions/129493/<?php echo get_template_directory_uri(); ?>/images/logo.png”>

Combining fancybox with multiple thumbnail plugin

I managed to get the result on my own after much playing with the codes. Here is the working code 🙂 <div class=”collections_dresses_container”> <?php query_posts(‘posts_per_page=-1&cat=10’); if(have_posts()) : while(have_posts()) :the_post(); ?> <div class=”collections_thumbnails”> <?php $imgID = get_post_thumbnail_id(); $url = MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), ‘secondary-image’); ?> <?php if ( has_post_thumbnail()) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), ‘large’); echo ‘<a class=”fancybox” href=”‘ … Read more

if is_bbPress register jquery

Completely out of any context (since it’s really not specified in the question), the correct method to enqueue jQuery only in the context of bbPress is to add an appropriate conditional inside of a callback, hooked into wp_enqueue_scripts. For example, the following would be defined in functions.php (i.e. not in a template or template-part file): … Read more

WordPress changing single quotes to double quotes in title and content

Add this code your functions.php Reference : Issue with double dash remove_filter( ‘the_title’ , ‘wptexturize’ ); remove_filter( ‘the_content’ , ‘wptexturize’ ); remove_filter( ‘the_excerpt’ , ‘wptexturize’ ); remove_filter( ‘comment_text’ , ‘wptexturize’ ); remove_filter( ‘list_cats’ , ‘wptexturize’ );

adsense code showing on random post thumb

Bit hard to understand exactly what you want to do as the grammar isn’t the best but i assume you want to return false for your Adsense widgets (using the code you linked to) when random posts thumbnail” plugin executes? You could add a check for the function your random posts thumbnail plugin uses so … Read more

ACF loop and php formatting

If it can be explicetly defined as the_title, then this should work for you: $pages = get_pages(array (‘sort_column’ => ‘menu_order’)); foreach ($pages as $page_data) { $fields = get_fields($page_data); if( $fields ) { echo ‘<div class=”the_title”>’ .$fields[‘the_title’] . ‘</div>’; echo ‘<div class=”container”>’; foreach( $fields as $field_name => $value ) { $field = get_field_object($field_name, false, array(‘load_value’ => … Read more

featured post as div background

You’re code is not working as you have an echo within an echo, try this code (not tested) <?php echo ‘<div id = “circ” style=”background: url(‘.$src[0].’><ul><li><a href = “‘.the_permalink().'</a></li></ul></div>’; ?> If you’re echo’ing something and then you want to add php within that echo you need to break the echo by adding ‘. $variable .’