FAQ Database Discussion Community


Display categories with styling

php,wordpress,categories
I am building my own Wordpress theme for a client. I want to display the categories, but with some styling. This is a screenshot of what I would like to achieve using categories: http://imgur.com/mtJPxMh (In these screenshots "Behang" and "Wanddecoraties" are categories being displayed.) I already created categories within Wordpress...

Making a customized forest plot of two groups using R

r,graph,plot,categories,percentage
I would really like to make a plot like this one using R. I've experimented with the forest() command from the metafor package but can't seem to create anything comparable. I also have two groups, multiple categorical variables, and percentages - basically, exactly the same kind of data shown in...

Wordpress - Custom plugin to return related posts by category

wordpress,wordpress-plugin,categories,posts
I'm learning how to create custom plugins for Wordpress, I am trying to get related posts by category. The problem is, I am returning all posts regardless of it's category whether it's the same category or not. I've done a var_dump on the $categoriesIds[] and it is pulling the right...

Wordpress list category in custom post type

php,wordpress,custom-post-type,categories
I have a query below which I want to list ONLY those categories assigned to the current post I am viewing. At the moment, it lists ALL of the categories for my custom post type. Is it possible to list just those for the individual post? The post type is...

Categorizing Posts in a Meteor Collection

javascript,post,meteor,categories,tagging
I have a Meteor Collection called Posts as shown below: Posts = new Meteor.Collection('posts'); I want to categorize them by a field I call "genre" and have different genre posts appear in different tabs in my navigation bar. I've tried installing tags for meteor and creating multiple Collections, but those...

Wordpress category filter with pagination

php,wordpress,filter,categories
is there any solution for filtering by post categories with pagination. At present, it only filter the posts are in the current page, but not anymore. You can see here: The Method Case Thanks!...

Wordpress: Display categories in two drop down and display the posts that is common for the categories selected in both dropdowns

php,wordpress,categories
I have created two categories say city and manufacturer. and I have added city names as subcategory to city and manufacturer names as sub-category of manufacturer. Example: city - newyork - paris Manufacturer - BMW - Audi Now I need to display City list in one dropdown and manufacturer in...

Order categories and subcategories in one table mysql

mysql,sql,order,group,categories
I have a category table like this: categories: id, name, parent_id How can I order categories? Sample: Men Top Shirts Tshirts Bottom Jeans Women Top Jackets Tshirts Bottom Jeans Accessories Belt Cap ...

Counting the number of pairs in a vector

r,count,duplicates,categories
Suppose that I have the following vector: V<-c(-1,-1,1,1,1,-1,-1,1) And I want to know the number of different pairs in the following categories: (1,1), (-1,1), (1,-1), and (-1,-1) In my example, there is exactly 1 pair of each. I have been trying to solve this problem with the function split and...

Category slug in article URL (ManyToManyField)

django,url,categories,slug,manytomanyfield
I am trying to build a URL pattern such as /category/article/ but the problem is, one article can be related to many categories, so the URL should be something like /category+category/article/ What I have: models.py from django.db import models from django.core.urlresolvers import reverse class Category(models.Model): name = models.CharField(max_length=128, unique=True) slug...

Relation between map function and mathematical concept of map

functional-programming,mapping,categories
I started reading "conceptual mathematics: an introduction in Category Theory". There, a map is defined as having a domain and codomain, with exactly one arrow leaving a given element of the domain and mapping it to an element in the codomain. However, my concurrent endeavours in Haskell show the map...

Categorise multiple rows into one variable

r,categories
A simple question, but apparently not answered in StO yet. I've got a long data frame where 3 of the columns are: person | trip | driver ======================= 1 car 1 bike 1 train 1 walk 2 walk 2 train 2 boat What I'd like is to populate column 'driver',...

Categories not working in production at heroku Rails 4

ruby-on-rails,heroku,categories
I am new to rails and still learning my application's Category function works in development but not in production at Heroku any help much appreciated. In my pins_controller.rb def index if params[:category].blank? @pins = Pin.all.order("created_at DESC").paginate(page: params[:page], per_page: 50) else @category_id = Category.find_by(name: params[:category]).id @pins = Pin.where(category_id: @category_id).order("created_at DESC").paginate(page: params[:page],...

Example of defining a functor in haskell between two categories (which are closely related to additive and multiplicative monoids)

haskell,categories,functor
I am trying to reconcile the math notion of functor and the haskell notion of it. This article http://brianshourd.com/posts/2012-10-26-tilt-functors-in-haskell.html explains a bit, but maybe someone can provide an example for the following case: Suppose i define the following categories Add: where objects are 0,1,2,3,...., morphisms are (0+), (1+), (2+), ......

Display subcategories of main category in sidebar in magento

php,magento,categories
I have some categories and their subcategories as below: Mobile Nokia Samsung Micromax Television LG Panasonic Philips Laptop Acer Dell When I click the category Mobile, in right side bar all categories and subcategories are displayed.But I need to display subcategories of Mobile only. That is Nokia, Samsung,Micromax only. How...

Python Pandas - Changing some column types to categories

python,numpy,pandas,multiple-columns,categories
I have fed the following CSV file into iPython Notebook: public = pd.read_csv("categories.csv") public I've also imported pandas as pd, numpy as np and matplotlib.pyplot as plt. The following data types are present (the below is a summary - there are about 100 columns) In [36]: public.dtypes Out[37]: parks object...

Wordpress List post categories that link to a page showing those posts

wordpress,blogs,categories
List post categories that link to a page showing those posts. Hi all I have posts with different categories. I have a blog page that lists the posts like this. <?php $blog_args = array( 'post_type' => 'post', 'order_by' => 'date', 'order' => 'ASC' ); $blog_loop = new WP_Query($blog_args); if($blog_loop->have_posts()): while($blog_loop->have_posts()):...

Can I get list of both posts and subcategories in AZ order?

php,wordpress,list,categories,posts
I have category that looks like this: category 1 subcategory 1 post 1-1 post 1-2 another subcategory 2 post 2-1 post 1 post 2 post 3 What I'm trying to achieve is list of posts and subcategories from category 1: another subcategory 2 post 1 post 2 post 3 subcategory...

Renumbering Categories in WordPress Blogs

mysql,wordpress,categories
I need to change one of my wordpress categorie ID. I found this solution (the post is from 2007 !) https://avi.alkalay.net/2007/10/wordpress-renumber-category.html UPDATE wp_categories SET cat_ID=1015 WHERE cat_ID=15 LIMIT 1; UPDATE wp_post2cat SET category_id=1015 WHERE category_id=15; UPDATE wp_link2cat SET category_id=1015 WHERE category_id=15; Can i use this query?...

Count the number of consecutive pairs in a vector

r,table,count,split,categories
Suppose that I have the following vector: V<-c(-1,-1,-1,-1,-1,-1,-1,-1,1,1) and I want to count the number of CONSECUTIVE pairs in the following categories: (1,1), (-1,1), (1,-1), and (-1,-1). In my example, there are seven consecutive pairs of (-1,-1), one pair of (-1,1), and 1 pair of (1,1). I am trying to...

Disabling links of categories on single product pages Wordpress

php,wordpress,hyperlink,categories
I dont know much about coding... I found some JS and Jquery to disable links here but I dont know how to use them and where to put them... This is the code in the title.php of my single product <div class="product-categories"><?php echo $product->get_categories(); ?></div> <h1 itemprop="name" class="product_title entry-title"><?php the_title();...

Show custom category field values on the front-end

php,wordpress,categories
I've found this script which works perfectly well. It adds a couple of extra fields to the categories page in admin. add_action( 'category_add_form_fields', 'category_form_custom_field_add', 10 ); add_action( 'category_edit_form_fields', 'category_form_custom_field_edit', 10, 2 ); function category_form_custom_field_add( $taxonomy ) { ?> <div class="form-field"> <label for="first_name">First Name</label> <input name="first_name" id="first_name" type="text" value="" size="10" />...

Magento product listing in categories randomnly sorted

php,magento,categories
When navigating in product categories, products are randomly sorted instead of being sorted by position. You can see the bug by refreshing this page several time: http://www.jollia.fr/collection-bijoux.html You will see different products each time. I have not made any change to the Product Category controllers. I have tried to reindex...

ElasticSearch in e-commerce: multiple categories for a product

elasticsearch,e-commerce,categories
How do you index products like that in ElasticSearch? We've separated all documents based on the attributes (colour, brand, size, whatever users input), but all of them belong to a set of categories. May be one, may be 15. [0] => Array ( [product_id] => 123456 [product_name] => Shirt 1...

How do you create a search bar like pinterest?

php,css,forms,search,categories
https://kimvij.files.wordpress.com/2014/09/new-interest-icons-plus-featured.png As you can see in the above image, you can select a category in which you can search. I know can create a search form with a select dropdown that has categories, but the thing is "select" dropdowns are hard to style with css and I wanted to make...