3
votes
1answer
61 views

How to add classes to images based on their categories?

I need to be able to: 1.) assign categories to images and 2.) add classes to all images that correspond to their assigned categories. I was able to add categories to images with the following: ...
-1
votes
2answers
41 views

Getting URL of archive (category) page

I'm trying to retrieve the current URL of the page, which works everywhere except for archive pages, for example, a category page. On a category page, it shows as the most recent post in that ...
0
votes
0answers
25 views

Getting categories from DataBase & WP Favorite Post

I am trying to create a shortcode that pull the most saved posts (using WP Favorite Post) and displaying them by YEAR, MONTH or CATEGORY. So far I have been able to get the year and month working ...
0
votes
1answer
15 views

Get category id for a custom category and display it in a class

I am having trouble displaying my custom category ID to my li ID. The code I am using below is displaying the post ID of the post category instead of the custom category. What I am trying to do is ...
0
votes
0answers
32 views

Limit to One Custom Taxonomy Selection, Including Most Used

I've got a bit of code that limits my custom taxonomy to only allow the user to select one category, by turning the checkboxes in to radio buttons. See the screenshot below for example: I need the ...
0
votes
1answer
44 views

List Categories of the Parent Category of the Current Category

So, let's say I have this structure of categories I. Super Cat A i. mini cat a ii. mini cat b iii. mini cat c I. Super Cat B i. mini cat a ii. mini cat b iii. mini cat c This code: <?php ...
0
votes
0answers
10 views

Archive list with only years and months belonging to a category

I need to generate a list of years and months belonging to a category. For example I have two main categories (A and B). I need a list of years and months of post published only of the category A and ...
0
votes
1answer
44 views

Rename Default Category (Uncategorized) Via a Function

I'm looking for a function to rename the default 'Uncategorized' category. The reason I need this is because I'm running a WordPress multi-site largely used by users with little technical knowledge ...
0
votes
0answers
39 views

Exclude a category of posts from all listings if user doesn't have a role

I have some categories that I'd like to bulk exclude from all listings (the loop on the main blog listing page, category listing pages, archives, etc.) and to show them only to users with a specific ...
0
votes
0answers
32 views

Wordpress Native Function To Show Publish Box, Select Categories Form etc On Plugin Page

The picture above showing the default forms those are available on metabox of wordpress post/page editor screen. Is there a wordpress native function to show those forms on a custom plugin page ...
1
vote
1answer
196 views

How to show only one category in breadcrumb navigation

I added breadcrumb navigation to WordPress & I'm facing one problem. Here's the function.php code of the breadcrumb: function ux_breadcrumbs() { if (!is_home()) { echo '<a href="'; ...
0
votes
1answer
46 views

Trying to see if page is category or single and displaying title with appropriate heading tag

I'm using a custom theme from ThemeForest and I'm trying to get the custom post php to check and see if the post is on a category or single post. If it's on category, use <h2> for the title (for ...
0
votes
1answer
170 views

Function to list posts from current post's category fails in WP 3.8

I have this function in my child theme's functions.php, whose simple aim is to list a number of posts, only from the category of the current post, but not the current post itself. It was working fine ...
0
votes
1answer
62 views

add slug beside name in Admin Category Checklists

im creating a lot of Categories with the same Name and different slugs, but im having problems identifying which is which in the admin panel, so i came up with the idea of inserting the slug besides ...
-1
votes
1answer
1k views

List only child categories a post is in, of a specific parent category

Either this is harder than it needs to be or I am just not understanding WordPress/PHP very well :( All I want to do is show the child/sub categories of a specific parent category...but only if the ...
0
votes
1answer
259 views

Random Featured Image Based on Category

I am looking to extend the below code to select a random featured image based on a specific category. The below works but uses an overall list of images to pull from vs a list of images based on ...
0
votes
2answers
1k views

Only show category to certain user levels without plugin

I'm building a site for some army guys to share photos, and one thing keeps stumping me. They have some photos that they'd like everyone who is signed up for the site to view, and others that just ...
2
votes
0answers
46 views

How to show in search results posts with a particular tag in a particular category?

As the home page of my blog I've a static page. There I want to show the navigation of the site. Category1 Sub-Category1 tag1, tag2, tag3 Category1 Sub-Category2 tag1, tag2, tag3 ...
0
votes
2answers
80 views

Displaying posts based on category

I recently got some help here on getting a few posts to display in block format. I was wondering if someone could assist me with modifying the code to limit the posts that show up either by category ...
0
votes
1answer
78 views

Redirect depending on category chosen

I'm using Ninja Forms and their extension to do front-end posts. They have a function that isn't working that is supposed to allow you to redirect to a specific "thank you" page depending on values ...
0
votes
2answers
309 views

How to add icon over specific thumb

I wanted to do the following, and I know its possible, but I don't know how. I'm looking at in_category, but it doesn't make to much sense. Basically what I want to do, for an example on my homepage, ...
0
votes
1answer
109 views

How to load several hierarchical categories from functions.php

I need to insert several categories (about 400) into my site. The categories are hierarchical. I would like to load them from functions.php but now I can add one category at time, like this: ...
0
votes
1answer
41 views

Adding Categories Through Function

I am creating a template theme for WP and am wondering if there is a way of the theme adding new categories to the db, through the functions.php upon activation of the theme. It seems like a fairly ...
0
votes
1answer
110 views

Showing custom post type categories in the menu

here is my custom post type and category: //Register nav register_nav_menus( array( 'main_nav' => 'Main navigation' ) ); //Custom post types add_action( 'init', 'create_post_type' ); function ...
0
votes
1answer
2k views

wp_list_categories, Add class to all list items with children

I'm using wp_list_categories(); to show a list of all the terms within a custom taxonomy but I need to style list items that have children differently to those that don't. Is there a way, PHP or ...
0
votes
3answers
171 views

Show only one category in main query, issues on tag page

I altered the following code from Ashfame: add_action('pre_get_posts', 'block_cat_query' ); function block_cat_query() { global $wp_query; if( is_home() || is_search() || is_tag() ) { ...
2
votes
1answer
53 views

How can I get an <h2> tag to wrap each ancestor that gets outputted in this condition?

I found this snippet in a different thread and it mostly does what I need, but I'm having trouble wrapping the individual pages this outputs with tags. All I can seem to add is a line break. I don't ...
2
votes
1answer
100 views

How can I list random authors from current post category?

The following lists authors of the current category. But I want this to be a list of 6 random authors from current post category. foreach((get_the_category()) as $category) { $postcat= ...
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 ...
3
votes
2answers
580 views

How to add the category ID to admin page

I want to add the categories ID to admin page. I call it for my functions.php: require_once('includes/categories_custom_id.php'); The part of code: function categoriesColumnsHeader($columns) { ...
0
votes
2answers
193 views

Change Default Content when Creating a Post based on Previous Category Choice

I'm working on a system that forces users (unfamiliar with wp) to choose a category before creating a new post, and then adds some appropriate html layout styling to help them. The following code ...
7
votes
2answers
319 views

Get rid of Wordpress category, tag and author archives?

I have searched the net with no success on what should be an easy thing. I have a highly customized blog with pages, sub pages and posts. While I rely heavily on the use of categories and tags I ...
1
vote
1answer
300 views

Changing post category from dropdown

I am showing a list of posts on the front of my wordpress site which each have a dropdown next to them with a list of category's, which are pulled in as follows. As you can see the form submit button ...
0
votes
1answer
507 views

How to add a custom thumbnail size for a specific category?

The default thumbnail size for the Wordpress theme I use generates category thumbnails for the homepage and archive page at 200x110px. I would like to add a custom thumbnail size for a specific ...
1
vote
1answer
134 views

If in category to be inside of a function

I have this code in WordPress index.php and I was wondering how can I transfer this in to a functions.php to be a part of a function? <?php if (in_category('featured')) : ?> <a ...
1
vote
1answer
941 views

Remove “Parent” Selection When Adding/Editing Categories?

I've been trying to find a way to hide/deactivate the Parent dropdown menu from the Posts -> Categories screen. http://example.com/wp-admin/edit-tags.php?taxonomy=category I was able to hide the ...
2
votes
1answer
534 views

How to generate and display widgets areas dynamically?

I want display different content in sidebar for every category, but as I create new ones I have to create the area for it. How can I have widget areas for every category and also display them on theme ...
0
votes
2answers
160 views

Change div background acording to the selected category

I'm coding a graphic menu that consist in five divs with a background each. On mouseover the background changes and the child div disappears. On click, each one works like a link to the correspondent ...
0
votes
2answers
316 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 ...
1
vote
1answer
360 views

Query posts from category based on a filter most favorited

I have one question. I need to query posts from category based on the filter most favorited ( http://pastie.org/2751114 ) which is placed in custom_sort.php to my index.php page This is how the posts ...
1
vote
1answer
245 views

exclude category from WordPress Form function

I have this function and I need to somehow exclude a category number 14 from my submission form. Is there any way to do it inside this function? function retrieve_cat_data($byid = false){ ...
0
votes
1answer
489 views

create function to call category name and slug

In several theme templates I have code to retrieve the category name and slug for the present post or category page. It is outside the loop. Here is the repeated code: global $post; $categories = ...
0
votes
2answers
975 views

Different size video display for category page (smaller) & detail page (larger)

I have a 'media' category page that pumps in videos / image galleries. I'm looking to have a smaller size video display (vimeo / youtube) on the category page, and the full size video on the single ...
0
votes
2answers
4k views

Check is category parent or not from its ID

question is simple (i don't know is aswer too ;) I just want to check that, does a category has child (or is ancestor) from its cat-id with a function. Eg. function check_category ...
1
vote
1answer
2k views

Check child/parent categories if exists

i am serching a WP function that controls is there any child category/ies of current category (in category.php outside of the loop) and if there is, just add link list for that category/ies to page, ...
1
vote
2answers
4k views

If category is in parent category?

I have function that check what is main top category of post. So i have category tree like this Foo -bar --foobar cat2 and if post is in foobar, my function post_is_in_descendant_category shows me ...