0
votes
0answers
23 views

All images from posts of specific category

I'm photographer and am developing my own portfolio, it's in the final stage. I'm trying to get all images from posts in a specific category. I can actually get all images from all posts, but they ...
0
votes
0answers
20 views

SQL update post category by post starting letter

I need to update post category based on post first letter. E.g. all post starting with "A" should go into "A" category. so far i can only select posts starting with "A". SELECT * FROM wp_posts ...
0
votes
3answers
77 views

Get a count of how many times a term or a category is used in posts

I need to find out the number of times a term/tag or category is used in a post in WordPress. I wrote the below SQL query. SELECT t.name , count(*)FROM wp_terms t JOIN wp_term_taxonomy tt ON ...
0
votes
0answers
39 views

Delete posts without category with SQL

A website I am working on has a 'lost' category uncategorized. It got deleted and now I have thousands of posts without category. Those posts are old an need to be deleted. How can I do this with SQL ...
0
votes
1answer
176 views

SQL Bulk Move old posts by one author to another category

I'm looking to move a number of old posts by one author from one category to another category and was hoping someone could help me do this? I figure the easiest way would be through an SQL command? ...
0
votes
0answers
136 views

Get posts under a category with SQL

How can I retrieve posts under a category with plain SQL with out using WordPress native api's like get_pages? My Wordpress table wp_terms contains a term named Restaurants. I want to list the post ...
0
votes
2answers
938 views

SQL query to get posts from multiple categories but not in a category

I need to get the last posts' ID and the post_tile within categories 1 and 2, and exclude those within category 3. It must be SQL, because if I use WP_Query it retrieves too much info and I only need ...
0
votes
1answer
51 views

finding out the top 5 source ( source is a custom taxonomy ), in a given category

The client I'm working with have thousands of articles and media ( audio/video ) files. To WordPress, all are posted by Author ID 1, which we named as STAFF. All the content though in reality has ...
-1
votes
1answer
280 views

SQL query to return categories and category parents

I have some categories which are not correctly defined. I.e. their parents are messed up. How can I select with SQL all categories and their parents?
0
votes
2answers
144 views

Assign a list of categories with a parent category

I imported hundreds of locations and other categories. Now I have a list of locations in categories to which I would like to assign the "Location" category as its parent. I have tried sql but the ...
0
votes
2answers
293 views

Wordpress Categories: Function using custom SQL to return array of specific category IDs

I'm developing a custom theme which uses categories for positioning, all of which begin with an underscore (e.g. _position1). I have an SQL query as below to get a list of these categories (those ...
0
votes
2answers
362 views

Display latest post from Wordpress Featured Category that is also in X,Y,or Z categories

I want to display the latest post from a "featured" category (id=1) that may also be in either X category, Y category, or Z category (id=2,3,4 respectively). Note, there are other posts in categories ...
0
votes
1answer
2k views

Overriding default calendar to show posts from a category

I'm trying to modify the default WP calendar (get_calendar()) so that it shows posts from a specific category and then use that as a shortcode. Here's what I've done: Copied across the ...
1
vote
1answer
853 views

Modify Wordpress SQL Query to pull from within a category

I am using a wordpress plugin called "kf most read" which stores a count of how many times a post was read, and lets you output a list of most read posts. This works well. The issue is, I am trying ...