0
votes
2answers
61 views

Displaying One Custom Post Type's Content On Single Post of Another Custom Post Type

I'm currently building a college football blog and I have 2 custom post types: conference and team. Each conference post type will be a horizontal list consisting of each teams' logo and will be ...
6
votes
1answer
154 views

Inject post (from specific category) between posts in Loop

I would like to add a post (from specific category) between posts in the WordPress Loop (such as 'Sponsors'). Example: P P P S P P S P P S P P How can I achieve this? I am a beginner with coding, so ...
0
votes
1answer
55 views

Get latest post from all categories except one

I trying to get all the latest post from every category, but I discovered I must ignore one of them. I don't want to show it at all. My problem is I don't know what syntax to write ifelse in this ...
0
votes
0answers
81 views

How to display Parent categories and Child Categories?

I struggleing to find the best way to develop the below. Basically my website will have a landing page on the site (Sports Landing Page) and when the user clicks on a category on that page eg ...
0
votes
2answers
97 views

Looking to exclude blog posts from category Previous/Next buttons

I'm working on some conditional elements here and I thought I had it but it's still not working right. You can see my site here. What I've done is displayed only category Legal Libation Columns (98) ...
0
votes
0answers
16 views

Make an array listing custom taxonomy

I am trying to populate an array with a list of categories in a custom taxonomy I created. The taxonomy, called clips, has a slug called clipcat. I only want the array to populate with children of a ...
0
votes
1answer
28 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
1answer
25 views

Showpost and last

I need your help. I would like to bring up the last (number) from my template classified ads. Here's the code: <?php $the_query = new WP_Query( array( 'showposts' => 10, ...
0
votes
0answers
12 views

Order posts by how many categories it is assigned to in total

I'm already doing some custom ordering based on various stored custom fields but this latest one has me stumped. I know I can get the count for how many categories a post is assigned to, but this only ...
0
votes
2answers
48 views

Trying to exclude posts from a category on the home page

I've tried the code below to grab the cat ID for one of my categories (watch-isatv) and exclude all of the posts in that category. However, the posts are not being excluded. What is wrong with the ...
0
votes
1answer
49 views

Query seems to be duplicated

I'm just hit a development brick wall and can't seem to find a solution to this problem. I've running two WP_Query's the aim is one displays premium stockists and the other one displays the none ...
0
votes
1answer
331 views

How to call Shortcode categories for custom post types?

Hi I'm trying to do something rather tricky in my Wordpress Theme I'm more of a designer front-end developer so its a bit of a guess work with php. Anyone have any ideas why this code only displays ...
0
votes
1answer
55 views

Top menu disapears in Category Pages when filtering using ACF

I am using ACF (Advanced Custom Fields) and filtering the results using the method they posted on their website. ...
0
votes
0answers
55 views

How to paginate categories and sub categories?

Here is my code so far: <?php if (isset($wp_query) && $wp_query->max_num_pages > 1) : ?> <div class="row"> <div class="col-md-12"> ...
0
votes
1answer
2k views

Display current category title on category page

Using the following code in a category template, but instead of showing the current category page that I am on, it displays the first category of the first post. For example on Food category page it ...
0
votes
0answers
321 views

How to show only subcategories in parent category not parent category?

I just want to show only subcategories of specific parent category on parent category page. I have 1 parent category videos and 3 child categories art,funny,and technology of that parent. I didn't ...
-1
votes
1answer
26 views

How to create categories out of a list of words?

I have a simple text file with a list of words (Berlin Hamburg Stuttgart ...) and so on. They are cities of germany an nearly 2000 counted. I need everyone of them as a category in my wordpress site ...
0
votes
1answer
51 views

Is there a way to randomize and connect a background and header image?

Right now I am using a different CMS, and I wrote a little bit of PHP which helps me (by using content from hidden pages) bring in a connected background and header and randomly display them, UNLESS ...
2
votes
1answer
43 views

Edit category output

I am using the following to display all the categories from my custom post type. How can I edit it so instead of having the output of the categories in <ul><li> elements it has <a href ...
0
votes
1answer
67 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
2answers
156 views

Creating sub-categories via php

Can someone tell me what's wrong here? I'm trying to create a category and a sub-category via PHP. My code is wp_set_object_terms($postID, array($subCategory, $catgeory), 'category'); But that ...
0
votes
1answer
91 views

is user member of a group, show them categories [closed]

I want to only display categories e.g. the 'group-1' category to users that are members of a certain buddypress group e.g. 'group-1'. I think I can do this by manipulating this code, and replacing ...
0
votes
0answers
58 views

Passing two values wordpress dropdown category

I have been following this guide on how i can pass two values to filter the post instead of one in wordpress category drop-down. The objective here is once the user selects a location and then selects ...
0
votes
0answers
100 views

wp_get_archive for category returning different URLs on different but similar sites

I have this code on two different sites in the sidebar: <ul class="news"> <?php wp_get_archives('cat=2&show_post_count=true'); ?> </ul> and this code in the main content ...
0
votes
1answer
176 views

Showing Subcategory Name/Link Instead of Parent Category

right now this code is showing an article's subcategories if it has one. But it's also showing the parent category too (so both the parent category and child categories show up simultaneously). Is ...
0
votes
1answer
123 views

Showing Subcategory's Name and Link Instead of Parent Category's

Right now my code is displaying the category name and link. But if an article is in a subcategory, I want to display the subcategory's name and link instead of the parent category's name and link. For ...
0
votes
1answer
28 views

Error trying import one category on page

I'm trying to post on this page only posts from category "Fotos Abertas" but I'm not getting, is showing all categories. Is there any error in the code of my template? <?php /* * Template ...
0
votes
1answer
639 views

Display all categories including sub categories

I am trying to display a list of all categories and sub-categories underneath that category, I have managed to get a list of all categories that are parents but am struggling to detect if it has ...
0
votes
1answer
268 views

How to check if a category has a parent and child categories?

Im trying to check if 'categoryone' has a parent. Right know I can check and see that there is a category called categoryone, but I want to check categoryone for parent and child categories. I have ...
0
votes
1answer
25 views

Show a Category Specific Info Box

I have a number of categories which are regions of the country (north, south, etc). I would like to display some kind of info box at the end of each post which falls into one of these categories ...
0
votes
1answer
261 views

Random Category with Recent Post Title and Thumbnail

This code below works perfect to pull the title of five random categories, the issue is for each random category I want the latest post title and thumbnail but where and how do I add the post query? ...
0
votes
2answers
404 views

how to show only specific category for a template

I have a custom template which should only show posts of specific categories. What do i need to change inside this code, to get this done? if ( ! function_exists( ...
0
votes
1answer
43 views

Wordpress custom taxonomy

I'm using a custom taxonomy called 'product_cat' and post type called 'product', I'm trying to display all parent terms, child terms and grandchild terms within the taxonomy. So I get a list like ...
-1
votes
1answer
785 views

Get Products within Current Product Category

I'm currently playing around with WOOCOMMERCE V2.0.13 and I'm trying to display each product from the current product category (e.g. Construction Products when on the Construction Page), I've managed ...
0
votes
2answers
84 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
89 views

!in_array doesnt recognize category

I want to fill an array with categories and tried to prevent duplicates with in_array: if ( $query->have_posts() ) { $categories = array(); while ( $query->have_posts() ) { ...
2
votes
1answer
104 views

Put a link to a category round a hard coded A HREF

In my footer I have hard coded the links and would like to link some to there category, I could just copy the full URL to it and paste in the href="" but I would rather call it using php. My ...
1
vote
2answers
384 views

Category Thumbnail Display - How to display ONLY the main Category

I am using the eList wordpress theme. Now on the main page, there is a thumbnail display of all the categories listed. Now, on the theme you will see that they have no sub-categories under the ...
1
vote
1answer
769 views

Filter Select results based on selection

I am trying to filter which job results are rendered to the page whenever the user changes the select item on my form. The select items are dynamically populated by the code below which assigns them a ...
0
votes
1answer
139 views

get_category only returning details for 'uncategorized'

I'm using the ACF Taxonomy field add-on to select a category and (hopefully) return details for that category, e.g. slug, title etc. The custom field get_field('category_test') returns the category ...
0
votes
1answer
308 views

How To Pass Array To get_the_category_by_ID() and Get An Array Back?

I am trying to pass an array of category IDs to get_category_by_ID() in order to get an array of category names back. Since I'm still trying to get this to work I'm just using var_dump() on the ...
0
votes
1answer
46 views

Menu's breaking, now showing all page links on site

There's something quite odd happening on a site I'm working on I can't figure out why at all. I have a custom post type set up for news and categories so the user can select what type of news it is ...
0
votes
1answer
501 views

dynamically filter by category via sub-menu

I'm trying to figure out if it's possible to dynamically filter my custom post types by category via a sub-menu I have set up. So I've set up a custom post type: news and enables categories that I ...
0
votes
0answers
41 views

Getting recent posts corresponding to category items in custom menu

I'm trying to create a tabbed navigation, each tab containing 5 recent post excerpts of category items that are listed in a custom menu. I'm planning to load all these posts at once and put each ...
1
vote
2answers
80 views

Where do posts get the sidebar from?

I'm trying to add an if statement on the sidebars that are displays in POSTS. I want posts to show a specific sidebar if it's in category x and display a different sidebar if it's not in category x. ...
0
votes
1answer
101 views

How to change links in the 3 main categories, on widget category, to a javascript function call

I'd like to know.. How could I change my 3 main categories links, so they call a javascript function? I'm using Snapshot Theme from WooThemes. Here's the current state of the website: ...
0
votes
1answer
512 views

Exclude a 'portfolio' custom category?

I have a custom post type called 'portcat' and I want to exclude one portcat category ('weather' - ID='5') from the page. I've tried 'category__not_in' => array( 5 ) but apparently this doesn't work ...
0
votes
2answers
664 views

How to display only one category in a custom post type?

I have a custom post type called 'portcat' and I want to display the results of only one portcat category ('games' - which has an ID of '3') on my page. The below code displays all of the categories ...
0
votes
0answers
132 views

How to exclude 2 Portfolio Categories from page?

I want to exclude 2 Portfolio categories (IDs 4 & 23) from a page using the code below but it still displays all categories. Similar code works for 'Posts' but not for 'Port' - can anyone see what ...
0
votes
1answer
119 views

go to home page when i select default in select-box

I'm new for WordPress. I'm using following code, <div id="cat_list"> <?php wp_dropdown_categories(array('show_option_all' => 'Categories') ); ?> </div> And my JavaScript ...