Custom Function for SEO by Yoast plugin

What you need is get_post_meta instead of get_post_type This: if ( get_post_type( $post->ID ) == ‘design’ ) { Should be: $meta = get_post_meta($post->ID,’your-meta-key’,true); if (!empty($meta)) { Put altogether function design_canonical_wpse_93717() { global $post; $meta = get_post_meta($post->ID,’your-meta-key’,true); if (!empty($meta)) { return $meta; // assuming this is an absolute URL } } add_filter( ‘wpseo_canonical’, ‘design_canonical_wpse_93717’ ); The … Read more

How to update WordPress custom SQL Select query for custom taxonomies so that syntax is correct?

You should not use a direct SQL query, instead try the WP_Query tax queries e.g.: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => array( 22 ) ), array( ‘taxonomy’ => ‘job’, ‘field’ => ‘name’, ‘terms’ => $terms, ‘operator’ => ‘IN’ ) ) … Read more

how to use the_excerpt for two post queries?

function excerpt($limit) { $excerpt = explode(‘ ‘, get_the_excerpt(), $limit); if (count($excerpt)>=$limit) { array_pop($excerpt); $excerpt = implode(” “,$excerpt).’…’; } else { $excerpt = implode(” “,$excerpt); } $excerpt = preg_replace(‘`\[[^\]]*\]`’,”,$excerpt); return $excerpt; } write below code in your template. <?php echo excerpt(25); ?>

Using Output from one Function and calling it into another

This isn’t really a WordPress question… that said $recClasses = pa_insertPage($output); is incorrect. here you should be passing to insertPage whatever the arguments are. Then insertPage will return $output, making $recClasses the same value as $output. $recClasses = pa_insertPage(‘your attributes’); // $recClasses now equals $output;