Tag Info

Hot answers tagged

6

An attachment is a Post The posts table contains information on the attachemnt post. In WordPress every uploaded media has it's own post entry, where post_type is 'attachment' and post_status is 'inherit'. In fact, you can get attachment post types using functions used to get other post types, like post, page or any CPT. That include WP_Query, ...


3

Here's one experimental idea: Assume we got: post A with the custom field location1 as UK - London post B with the custom field location2 as France - Paris post C with the custom field location3 as USA - New York Then we could use, for example: $args = [ 'meta_query' => [ 'relation' => 'OR', [ 'key' ...


2

Firstly, I would consider using one of WordPress' wp_kses-like functions, instead of PHP's strip_tags(). Secondly, query your posts with WP_Query or get_posts() with the fields parameter set to ids - seems like you don't need more than that. Thirdly, split up your loop into steps that are effective and manageable. Because 34000+ posts will likely reach the ...


2

Lets break this down, Advanced Custom Fields (ACF) does save the data as custom field/post meta, I guess it seems all to obvious, but it is better to confirm it, and ElasticPress does set up custom fields automatically to include them into the search index. ElasticPress does this unless the meta data is hidden, which is the case if the custom field name is ...


1

Your have two major issues here The string you are building is correct, but it gets overriden on each iteration of the loop, which at the end will only hold the info from the last post. You need to define your variable outside the loop and then concatenate your info to that variable across the entire loop in order for you to display all postdata from all ...


1

The quickest solution is export posts table from database, replace tags this using any code-editor. For posts content are simple text not serialized, in this way you can do all replacement in less than 10 minutes without any hassle. Then import the sql file in db. Thanks


1

The easiest way to do this would be via SQL. Firstly take a backup of your database in case anything goes wrong. Then using phpMyAdmin or a similar SQL frontend run this SQL command: UPDATE wp_posts SET post_content = REPLACE(post_content, '<br>', ''); This will replace the tag <br> with nothing in all post content. If the tags are in ...


1

First is showing the attachment file path, second is file attributes size, type, height, width etc. Thanks attachment in wp_post shows the attachment basic details title, time, author etc. wp_postmeta shows attachment all other details for example attachment would be text, pdf, image etc so it having different meta data for different types of posts. ...



Only top voted, non community-wiki answers of a minimum length are eligible