Set Primary category using the Yoast SEO plugin

Try instead update_post_meta($post->ID,’_yoast_wpseo_primary_category’,$childid); Use below function: function wpseoPrimaryTerm($taxonomy, $postID, $term){ if ( class_exists(‘WPSEO_Primary_Term’) ) { // Set primary term. $primaryTermObject = new WPSEO_Primary_Term($taxonomy, $postID); $primaryTermObject->set_primary_term($term); // Save primary term. $primaryTermObjectAdmin = new WPSEO_Primary_Term_Admin(); $primaryTermObjectAdmin->save_primary_terms($postID); }else{ echo ‘Class WPSEO does not exit’; } } Where $taxonomy – taxonomy name, $PostID – $post->ID, $term – $childid

root-relative links for multiple parked domains

I tracked the function calls in my theme (a child theme of Oenology by Chip Bennett) and wp-include that generate the links, found the home_url() function, and then wrote these functions for my site: function gregory_make_relative($url=””) { return preg_replace( ‘#^https?://[^/]+/#iu’, “https://wordpress.stackexchange.com/”, $url, 1 ); } add_filter( ‘home_url’, ‘gregory_make_relative’, 11, 1 ); I intentionally grep-searched to … Read more

Custom Yoast Breadcrumbs URL

That’s an unusual setup – Yoast usually recognizes the right permalinks. You may want to consider changing the way you set up your custom post type, so that it has the desired names and URLs to begin with. You’re likely to have two different URLs that point to the same content, which is undesirable for … Read more

Removing “Noindex, follow” from pages [closed]

Ooohhh you mean “pagination” pages. Gotcha now! It’s hard to say for sure(I know I know), but at first glance it looks like this block of code would be what you’re after: if ( $wp_query->query_vars[‘paged’] && $wp_query->query_vars[‘paged’] > 1 && isset( $options[‘noindex-subpages’] ) && $options[‘noindex-subpages’] ) { $robots[‘index’] = ‘noindex’; $robots[‘follow’] = ‘follow’; } }

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