get post excerpt by query
You’re querying post_content but selecting post_excerpt. These two things are not the same. Perhaps the text you are searching for is in more than one post?
You’re querying post_content but selecting post_excerpt. These two things are not the same. Perhaps the text you are searching for is in more than one post?
Try in_category again, but also with specifying the post id: if (in_category(‘destaque’, $post->ID)) { //do whatever you need to }
Looking for the solution, I want to give more information about what I have done so far: My Actual configuration – WordPress : 3.8 – PHP : 5.3 – Theme : custom based on _s (underscore) – Hebergeur : local XAMPP My archive template <main id=”main” class=”site-main” role=”main”> <?php // get all the categories from … Read more
Change link to permalink inside post content
The documentation for the save_post action says: save_post is an action triggered whenever a post or page is created or updated, which could be from an import, post/page edit form, xmlrpc, or post by email. So, you should only need the save_post action to run the desired code when the post is changed.
You need to edit your theme’s category.php file (or archive.php if you don’t have a category.php file). You need to remove the the_excerpt() or the_content() line, whichever is present there.
Adding custom fields to the Quick Edit screen – puzzled about the column concept
value is not a valid parameter for get_posts and the tax => slug meta query pattern is long since deprecated, as has been numberposts. Even if value was valid it is hard to see how passing a literal date(yyyy-mm-dd) to it would work. At any rate, I believe that applying a posts_groupby filter would do … Read more
so I took a look at your updated code, and it looks like where you’re writing: $audio_url = get_post_meta($post->ID, ‘$key’, true); //this is getting your custom field url You forgot to replace ‘$key’ with the actual string name of the meta you’re looking for, which judging from your functions, is called ‘link’. So I edited … Read more
Your code is flawed. You should never delete posts by issuing SQL directly to the DB. Use WP_Query to find the posts that are duplicates and wp_delete_post to delete them. Your current method might generate a lot of garbage in the DB. Side Note: Best way to prevent duplication is not to allow them to … Read more