0
votes
2answers
158 views

wp_insert_category() setting the 'cat_ID' gives not array error

I'm writing a plugin that automatically creates a bunch of stuff ie categories and child categories. But when I use the following code to create the categories: (from wp codex) //Create Post ...
0
votes
0answers
107 views

Change permalink based on post category

I am looking for a way to change the permalink structure based on the category a post is in. If the post is in the "blog" category I would like the permalink to be /blog/%postname%/ and if it is any ...
0
votes
0answers
90 views

Filter EVERY category link with my plugin

Im writing a plugin to let users customize the colors of their category links. But in order to make this work, Ive gotta figure out a way to target all category links regardless of theme. So clearly ...
0
votes
1answer
51 views

Load stylesheet in edit category page?

I have a plugin that I want to add a stylesheet to each "edit category" page because I added additional custom fields into those pages. Is there a simple way of doing this or do I have to use the URL ...
0
votes
1answer
67 views

Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites

I've built two WordPress sites. One is public site--people go to it, view my content, etc. The other site is a private course catalog. In the course catalog I have 3 custom post types. The content of ...
0
votes
1answer
58 views

How to relate the Category to user?

I am developing one new plugin, In that i had a section to create new category, and having the field Created By(listing all the users in this field). I am storing the category name in WP_terms and ...
2
votes
1answer
2k views

WP Query group/order by category name

I have a requirement for displaying a list of custom post types grouped by category, but in addition to this, each custom post is linked with a meta value (in this example lets say we have a custom ...
0
votes
1answer
42 views

How can I add the custom taxonomy categories to the posts and pages?

I'm trying to build new wordpress plugin. Additional to the default wordpress categories box in the publishing screen of posts and pages, I want to add another box for custom taxonomy categories , How ...
0
votes
2answers
119 views

How can i call from custom fields to the category editor?

I found this code for custom field add category editor. I added custom field to the Category. e.g. My field name is Hastag and i have a Sport category. And i want to call display Sport's custom ...
0
votes
1answer
83 views

How can i listing current category and Featured Category post list?

I have a Featured Post Category. Im marked some post Featured. When i viewing a category page(e.g. Sport), i want to list on sidebar both marked post list (e.g Featured and Sport,) I tryed with that ...
1
vote
1answer
226 views

How to Make a Category Always Selected?

I'm trying to write a function to make certain terms of default category always selected. When the user is writing a new post, the term checkbox should be checked and he shouldn't be able to unckeck ...
2
votes
2answers
239 views

prevent post to have multiple categories in my plugin

I'm writing a plugin, I want to prevent posts have multiple categories (i.e same product having category "Samsung" & "Apple"). Any idea on how to use some actions/filters to achieve this using my ...
0
votes
2answers
140 views

how do you prevent showing a particular category on the admin dashboard for specific user roles?

I'd like to prevent the "Featured" category from appearing for certain user roles. To be specific, I want only the admins and editors to be able to see and thus select or unselect that category. ...
0
votes
2answers
302 views

Get category id when SEO URL is turned on

<?php /* Plugin Name: Members */ function myFilter2($query) { if ($query->is_category) { $currently_listing_categories = ...
1
vote
1answer
575 views

Show add_meta_box by selecting a specific category

In my plugin I want to display an add_meta_box under the WYSISWYG in the new post page, which is no problem and works fine. But the box should only appear when a specific category (example: category ...
0
votes
3answers
338 views

How can I show posts for a single category?

Is it possible to show posts for a single category? I tried browsing to the URL http://mysite.com/category/foo which does show all of the posts with category foo, but the posts lose their formatting ...
0
votes
1answer
661 views

wp_insert_post_data filter to set category

I am trying to set additional "default" categories. I figured by hooking into the wp_insert_post_data filter, I could use $postarr to set the category. It doesn't seem to be working? Can someone offer ...
0
votes
1answer
203 views

Check if post belongs to any category

I've got a custom post type which displays portfolio items. I display the portfolio category on the page using this code: <?php $myterms = get_the_terms($post->ID,'portfolio_category'); ...
0
votes
1answer
363 views

How to Show Category List With Corresponding Links?

i want to do a research in Category List Area. I'll Explain Here... Now I have 4 Categories Like 1,2,3,4. First of all it needs to show in the category pages Horizontally.Next is, While Clicking on ...
0
votes
3answers
3k views

How to get Recent Post From Each Category with Thumbnail?

For Example,Now I have 3 Categories Like Food,Transport,Technology.Under These Categories I have Many Posts.Now I Want To Show the Latest Post From Each Category.{How to get Recent Post From Each ...
2
votes
2answers
748 views

Calling clean_term_cache() fails when called in the same plugin that creates terms, succeeds when called separately?

My plugin code is below. In the myPlugin_cleanup() function, I'm creating some categories and assigning term id 1 as the parent. Due to the known bug with creating categories via script (the ...
1
vote
2answers
460 views

Missing “category_children” option when dynamically creating categories via a plugin

I've isolated the source of a fatal error that's been occurring when a brand new site is previewed just after installing and activating the plugin I'm working on. The problem appears to be that the ...
4
votes
3answers
5k views

add_action hook for completely new post?

publish_post Runs when a post is published, or if it is edited and its status is "published". Action function arguments: post ID. -Plugin API Documentation I've added the publish_post ...
1
vote
1answer
1k views

Filter Categories widget to allow custom sorting?

Man, I can't seem to ever get done with enhancements to WordPress categories. I hope there's more work done on core category options in the future. Especially with the emergence of site theming and ...
0
votes
2answers
496 views

Best/Correct way to add an option to a category

I'm currently writing my first plugin, which will let the site admin/editor use a different image as a background/header for each post/page, and I would also like to have defaults for each category. ...
0
votes
1answer
278 views

Which are the hooks run before/after when a category's deletion?

What are the actions that a plugin can hook on to for processing when the user deletes a category?
1
vote
3answers
2k views

anything like add_meta_box for categories?

I want to add few custom fields to categories. So I am looking for something like add_meta_box but for categories. Is there any WP function like that for categories?
0
votes
1answer
256 views

Getting a List of Categories for Use in a Plugin?

I need to access a list of all categories for a plugin I'm working on, I know that there is the wp_list_categories template tag for use in themes. What would be the best way of accessing these ...