FAQ Database Discussion Community

Wordpress: Custom post type segregation on Category page

I've got two custom post types, for example 'Cars' and 'Bikes'. I've used Wordpress's default category to categorise the posts from the two post types. Let's say for example the categories are 'Red', 'Blue' and 'Black'. What I'm trying to achieve here is that when I go to the category...

Get categories from numeric vector

I have this numeric vector: vec <- 1:7 How can I transform it into 3 categories using these logical rules: if(vec >= 1 && vec < 4) then "category1" else if(vec >=4 && vec < 6) then "category2" else if(vec >= 6 && vec < 8) then "category3" The expected...

Convert list-of-dicts into tree

For two days I try to traverse a list of dicts into a tree. `list_of_dicts = [ {'name':Category1, 'id': '7', 'parent_id': '7', 'level': '1'} {'name':Category3, 'id': '33', 'parent_id': '7', 'level': '2'} {'name':Category5, 'id': '334', 'parent_id': '33', 'level': '3'} {'name':Category10, 'id': '23', 'parent_id': '7', 'level': '2'} {'name':Category2, 'id': '8', 'parent_id': '8',...

R plot categorial changes - sankey diagram

Does somebody know how to plot changes of two categorial variables in R? Such as in this example: http://www.sueddeutsche.de/politik/waehlerwanderung-in-hamburg-wer-wem-die-stimmen-stahl-1.2353382 (Without the dynamics) So I have two categorial variables like: Pre and Post Pre = sample(1:100,10000,replace=TRUE) Post = sample(1:100,10000,replace=TRUE) Thanks for any advice!...

get by category id [closed]

thanks for helps for my last question I have a problem with my project in Topic class for view all the topics in a special category Check out my Function in the 'Topic' class: /* * Get topics by Category */ public function getByCategory($category_id){ $this->db->query("SELECT topics.*, categories.*, users.username, users.avatar FROM...

what is the requirement of oc_category_path table exists in opencart?

I am unable to understand the concept of having category_path table in opencart. Can any opencart expert here explain with a scenario/example?

How the getter/setter implement when add a @property in category with @dynamic

I add a property to my category and use @dynamic in my category implementation. It seems work well. @interface aClass (Properties) @property (nonatomic, readonly) NSString *p; @end @implementation aClass (Properties) @dynamic p; @end I know @dynamic means tell The compiler not to automatically synthesize the getter and setter methods.but why...

Display a specific form depending on the product category - Woocommerce and Contact Form 7 [closed]

I'm using Woocommerce and Contact Form 7, and I want to embed a specific form in the product description template, depending on the product's category. In other words, for every product under the category "Shoes", I want a specific form called "Contact Form Shoes" to be displayed in the description...

In OpenCart, How can I customize the info visible on the product page

Okay, first I want to say that I am not a geek programmer. I am intermediate to programming. I was recently learning Php through teamtreehouse, which I have not finished yet. But instead I started making an online store from OpenCart. I watched some youtube videos and added some products,...

How does MediaWiki sort page links in category overviews?

The answer should be: alphabetically. Currently, I have a page starting with 'A' appearing in the 'S' section of the category overview page. Screenshot: http://i.stack.imgur.com/pKide.jpg I have a small Wiki running for my team: MediaWiki 1.22.2 PHP 5.3.29 (litespeed) MariaDB 5.5.40-MariaDB and this is the first time I have ever...

Use PHP in Array and Title For Wordpress Term Creation

So I'm trying to create two categories when the user logs in. I need the category names to be the username of the user who is logging in. I'm fairly new to PHP and I've been looking through the Codex and I know how to get the user information but...

create quantile category variables using defined cut-points in Stata

I am trying to create indicator variables using different quantile levels. I am creating a variable that contains categories corresponding to quantiles. For one variable, the code I am using is xtile PH_scale = PH, nq(4) tab PH_scale, gen(PH_scale_) Also, I know that if I want to use my own...

Netbeans project categories only show “XML” and “Other”

Been searching a lot to solve this problem, tried lots of things and still couldn't fix the problem. I mainly want the Java project categories to show up. I have NetBeans IDE 8.0.2, Java SE Development Kit 8 Update 40, 64 bit version. Tried reinstalling Netbeans, tried deleting the Netbeans...

How to convert flat array of objects with “categories” and “subcategories” to tree with JQ?

I have a JSON array of objects with groups and subgroups that looks like this: [ { "Group name": "Elevation", "Subgroup": "Contours", "name": "Contours - Labels" }, { "Group name": "Elevation", "Subgroup": "Contours", "name": "Contours" }, { "Group name": "Elevation", "Subgroup": "Cuttings", "name": "Cuttings" }, { "Group name": "Framework", "Subgroup":...

Stratifying a density plot by different groups using ggplot2 in R

I have a data frame in R called x that has hundreds of rows. Each row is a person. I have two variables, Height, which is continuous, and Country, which is a factor. I want to plot a smoothed histogram of all of the heights of the individuals. I want...

Show product-category thumbnails in loop which have n price of products in woocommerce

I want to show category thumbnails in loop which has n price of products. Here n price will put from admin panel where a amount will fill and that products-category thumbnail will appear on a page which having that amount or greater than that amount of products. so please help...

Do I need to use posts or pages in WordPress?

I am working on a medical news website (WordPress) and I'm doubting for a while because I don't know if I need to create posts or pages to show information about health conditions. I've read a lot of articles about pages vs posts and I know that posts should be...

How to Display Terms for all posts in Current Archive or Query in wordpress

I have custom post types with select option.In select option I got all the taxonomy categories and on change of select it displayes all posts of post type but when I go to single page it displayes only this current post not all from this category. I tried this code...

Show count of posts in subcategory on Wordpress

How would I show a count of only those posts found within a subcategory to be displayed in the archive page of that subcategory? So if I navigate to the Food > Fruits archive page I want to display a count of how many posts are filed under just under...

Is there a way to create duplicated subcategory slugs on Wordpress?

I've googled around for this like crazy, but can't seem to find a not too outdated answer for this question or something that actually works. My problem is just like the one this guy describes on this forum post (from 4, holy FOUR years ago!): https://wordpress.org/support/topic/duplicate-subcategory-slug-problem I'm currently using the...

Remove Title Link for Specific Category in Wordpress

I'm running Wordpress 4.1. I have two blog pages on my site, and though I don't really know php, I've done some tinkering and figured out how to modify the page templates so each page only displays posts for a specific category. That bit of code looks like this: <?php...

how to redirect empty parent category to its first non empty child category in wordpress

In Wordpress, If parent category is empty then it will redirect to its first child category that is not empty.