functions.php not adding css to website?

I don’t know if you try to add a css file in your theme or plugin. I will provide both examples. Use wp_enqueue_style in combination with get_theme_file_uri to enqueu a stylesheet in your theme directory. For a theme, see example function add_styles() { wp_enqueue_style( ‘fontawesome-style’, get_theme_file_uri( ‘/assets/css/all.css’ ), array(), null ); } add_action( ‘wp_enqueue_scripts’, ‘add_styles’ … Read more

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

Insert code when users come from an specific referer

Your post does make sense, you just want to change/add some content based on referrer, which is very common among websites. Now, as you asked just at the start of body. I don’t believe there is any standard hook in there, other than get_header();. This function is usually located at the very beginning of most … Read more

Comment filtering (search)

You create your own comments_template, it can be a duplicate function of the default one, the only changes are the database queries anyway. But you need your own function as WP doesn’t help you with filters here. SO, name it my_comments_template(): $filter = mysql_real_escape_string($_POST[‘comment-filter’]); if(!empty($filter)) $filter = “AND (comment_content LIKE ‘%%{$filter}%%’ OR comment_author LIKE ‘%%{$filter}%%’)”; … Read more