How to call a specific value within the functions.php file?

function youtube($atts) { global $post; $value = get_post_meta($post->ID, ‘video_link’, true); extract(shortcode_atts(array( //Make sure not to include the ‘value’ as part of this array. “width” => ‘475’, “height” => ‘350’, “name”=> ‘movie’, “allowFullScreen” => ‘true’, “allowScriptAccess”=>’always’, ), $atts)); return ‘<object style=”height: ‘.$height.’px; width: ‘.$width.’px”><param name=”‘.$name.'” value=”‘.$value.'”><param name=”allowFullScreen” value=”‘.$allowFullScreen.'”></param><param name=”allowScriptAccess” value=”‘.$allowScriptAccess.'”></param><embed src=”‘.$value.'” type=”application/x-shockwave-flash” allowfullscreen=”‘.$allowFullScreen.'” allowScriptAccess=”‘.$allowScriptAccess.'” width=”‘.$width.'” height=”‘.$height.'”></embed></object>’; … Read more

Code that displays images – images get shown multiple times

Something like this might work: <?php $cat_id = get_query_var(‘cat’); $catlist = get_categories(‘hide_empty=0&child_of=” . $cat_id); echo “<ul>”; foreach($catlist as $categories_item) { echo “<h1><a href=”‘ . get_category_link( $categories_item->term_id ) . ‘” title=”‘ . sprintf( __( “View all products in %s” ), $categories_item->name ) . ‘” ‘ . ‘>’ . $categories_item->name.'</a> </h1> ‘; echo ‘<p>’. $categories_item->description; $terms = … Read more

Retrieve IDs from custom field, count and display results differently according to count

I answer to myself, since this code is working better (previous had an issue) and also I removed a useless “for”: echo ‘<ul class=”related-content”>’; $count = 0; foreach(get_field(‘related_content’) as $post_object) : $count++; if ($count > 0 && $count < 4 ) { printf(‘<li class=”large”><a target=”_blank” title=”‘.get_the_title($post_object->ID).'” href=”‘.get_permalink($post_object->ID).'”><span style=”display: block” title=”‘.get_the_title($post_object->ID).'”>’.get_the_post_thumbnail($post_object->ID, ‘small’).'</span><span class=”thumb-title”>’.get_the_title($post_object->ID).'</span></a></li>’); } elseif ($count … Read more

When I use rewind_post() it shows menu items in my loop

I found the problem, this function was causing the problem…. function include_custom_post_types( $query ) { $custom_post_type = get_query_var( ‘post_type’ ); if ( is_archive() ) { if ( empty( $custom_post_type ) ) $query->set( ‘post_type’ , get_post_types() ); } if ( is_search() ) { if ( empty( $custom_post_type ) ) { $query->set( ‘post_type’ , array( ‘post’, ‘page’, … Read more

Force string into signup form

Not sure where you are placing the code as you don’t say – but you will need to edit the WordPress signup code / file and add your random string code in there and then hide the input for the sub-domain or set it to disabled and set it’s value to the random string. You’ll … Read more