How is the author’s name given a different color?
You wrote .comment-list but that’s not the class, it’s .commentlist. You may also need to target the anchor link inside that tag explicitly to override link colours
You wrote .comment-list but that’s not the class, it’s .commentlist. You may also need to target the anchor link inside that tag explicitly to override link colours
You should use @wordpress/scripts so you can profit from modern JavaScript language features and JSX and transpile it to browser-compatible code. It’s really not complicated to use. Just install it via npm install @wordpress/scripts –save and than you can transpile your source file like this wp-scripts build src/myguten.js.js –output–path=js. It’s not only modern language features … Read more
Ok so we have things, and we want to favourite/unfavourite them as done. First, we need 2 functions: saeed_is_favourited( int $post_id, string $thing_to_favourite ) ( where $thing_to_favourite is the thing we’re marking as saved/favourited/etc, and $default is the value to return if we don’t know yet saeed_set_favourited( int $post_id, string $thing_to_favourite, bool $favourited ) where … Read more
This makes no sense, required $key argument (defines which custom field value you want to retrieve) is missing: $post_meta = get_post_meta( $post->ID ); How are you actually assigning this to post? In this snippet you only assign array to some arbitrary variable: $brand_meta = array(… Also please clarify your condition, I am not sure what … Read more
In WordPress these boxes are called “meta box” and to add one to your new/edit page screen you can use add_meta_box() function (look at the example at the bottom for the examples), you can also use this class which is nicely documented and does most of the job for you. Or you can use a … Read more
foreach ($boxes as $data) { $project[$data] = get_post_meta($post->ID, $data, true); } $item_a = $project[‘height’]; $item_b = $project[‘width’];
You have to do a join or a subquery: $querystr = ” SELECT $wpdb->posts.ID FROM $wpdb->posts WHERE $wpdb->posts.post_type=”post” AND $wpdb->posts.post_date < NOW() AND $wpdb->posts.ID NOT IN ( SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = ‘_social_’ ) ORDER BY $wpdb->posts.score DESC LIMIT 1; “;
DELETE wp_posts FROM wp_posts INNER JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID WHERE (wp_postmeta.meta_key = ‘InternalOnly’ AND wp_postmeta.meta_value IS NOT NULL);
You have syntax error in query arguments: ‘orderyby’.
When you are in your while loop, the parent query is already finished. So fetch the post meta value with get_post_meta(): $template = get_post_meta( get_the_ID(), ‘_wp_page_template’, TRUE );