How to get post’s current parent term ID?
If you just need IDs, get_ancestors will return an array of parents for any type of object: $term_id = 21; $ancestors = get_ancestors( $term_id, ‘location’ );
If you just need IDs, get_ancestors will return an array of parents for any type of object: $term_id = 21; $ancestors = get_ancestors( $term_id, ‘location’ );
Gradient and boxshadow are fine to put inline. Your trouble will be with the hover states. Luckily there is a trick. You can put the hover styles in an outer element and force inherit on hover. Like this: <div class=”myshortcode”> <a style=”color:blue;”><span style=”color:red;”>Content</span></a> </div> In your style.css you add this generic line with a transition … Read more
If your theme has body_class() in the body tag (normally in header.php) then the category name is added to the body tag as a class e.g. <body class=”my-category”> So in a css file you can do .my-category #my-element { background:#FF0000; } To edit the html for the categories to make them card layouts then you … Read more
This is actually a MySQL question and not related to WordPress but you can replace now() with NOW() + INTERVAL 1 DAY
You can use meta_query to combine multiple queries using either AND or OR relation. Granted, it does get a bit complex in this case, but because you can nest multiple queries, you can still achieve it. This is covered in the WP_Meta_Query documentation and also to an extent in the WP_Query docs. Here’s what I … Read more
A dev version clearly needs to be created. Resolving this will take time. You will need debug and the ability to experiment with disabling plugins. Chances are, the slowness is caused from a bad query with a plugin. Or too many scripts. Also, 100mb of memory is far inadequate for a site with that much … Read more
I solved the problem by installing php-ssh2, which removes libssh2-php on the install. $ sudo apt-get install php-ssh2 I also had to change permissions on the wp-content folder to 775, but it worked leaving the wp-content/plugins at 755. $ chmod 775 wp-content
OK – so, first, you don’t need to serialize/unserialize. get_user_meta() will return an array, and delete_user_meta() can remove a specific value. So, simplifying a few other things here and below, your remove function would work like this (very simple): function teo_bookmark_remove() { $postID = $_POST[‘post_id’]; $current_user = get_current_user_id(); delete_user_meta( $current_user, ‘bookmarks’, $postID ); } Likewise … Read more
Solution, using and statement ‘&&’ for another specific role. Closing <?php if() : ?>, <?php else : ?> Tag with a Column : to be able to post scripts inside the Loop. <?php global $current_user; // Use global get_currentuserinfo(); // Make sure global is set, if not set it. if ( ! user_can( $current_user, “administrator”) … Read more
How to escape attachment image caption text?