WordPress Categories vs URL Structure - wordpress

I just launched my first WordPress site, and I'm confused by WordPress' Categories feature. I would like to set it up so that I have three URL structures:
Regular posts display # mysite.com/post-title
Posts in the category "World" display at mysite.com/world/post-title
Posts in the category "Issues" display at mysite.com/issues/post-title
It looks insanely simple, yet it isn't working for me. I went into Dashboard > Settings > Permalinks and entered "world" where it says Category base. I don't know how to add "Issues," because you can apparently only add one category here.
Then I went into Posts > Categories and created two categories - World and Issues. I then created a new post and assigned it to the category World. (I also entered a lower case slug version.) But the post displays at mysite.com/post-title, not mysite.com/world/post-title.
In summary, I would like to be able to 1) create a category (e.g. World), 2) create a new post and assign it to that category, and 3) see that category represented in the URL structure (e.g. mysite.com/world/post-title).
Can anyone tell me what I'm doing wrong?

Related

I cannot create the same category name in Wordpress

I need to make a category system according to years. For example
Iphone
Samsung
Xiaomi
Then I should assign years as subcategories to these categories.
2022
2021
2020
After all, there needs to be a structure like this.
Iphone/2020
Iphone/2021
Iphone/2022
Samsung/2020
Samsung/2021
Samsung/2022
Xiaomi/2020
Xiaomi/2021
Xiaomi/2022
In this table, the main categories are Iphone, Samsung and Xiaomi. When I want to open a subcategory for each main category, it creates a permalink problem. The problem I want to solve starts right here.
There is no problem with the first categories. The link structure is as follows.
example.com/iphone/2020
example.com/iphone/2021
example.com/iphone/2022
But when opening the 2nd and all other categories, the link structure is as follows;
example.com/samsung/2020-samsung
example.com/samsung/2021-samsung
example.com/samsung/2022-samsung
When I want to fix the permalink, I get an error like "the slug "2020" is already in use by another term".
There are many sites using this structure. However, I could not find how to do it. I think another structure is used for this process, not the wordpress category system. I would be very grateful if you help me.
The problem I think is in the fact that wordpress manages the categories all together, therefore the "2020" category exists, because you have already created it, you should see if you can use it as a subcategory

how to get list of admin column name in wordpress

I am developing a custom WordPress plugin so I need to retrieve the list of all column in to my plugin file can anyone help me to how I get the list of below column.
in my case how I get list like.
I need a list like
author, title, Tags, categories, Date, Short code

WooCommerce Custom Attribute being indexed but shows no results

We're running WordPress 4.7, WooCommerce 2.6.9 and the Algolia 1.6.0.
We've got 7 indexes setup:
Searchable posts [searchable_posts]
Posts [posts_post]
Pages [posts_page]
Products [posts_product]
Brands [terms_product_brand]
Product Categories [terms_product_cat]
Full Code [terms_pa_full-code]
The first 6 all return results as expected but Full Code [terms_pa_full-code], although indexed returns no results. However, there should be several 100 if not 1000 as if a product has a Full Code it is set to be 'Visible on the product page'.
Because it's showing as something that can be indexed I'm assuming we don't need to do any custom coding so not sure why it wouldn't display any results?
Has anyone experienced anything similar
The terms_pa_full-code does only contain some metadata, not the values which are them correctly pushed as part of the product data if everything goes well.
You can then use values of that taxonomy as a facet to display a list of available options given a user search query.
You can also register for the Algolia plugin for WooCommerce here: https://community.algolia.com/wordpress/#woocommerce and get this setup for you in a few clicks.

How to generate a feed for this category within a Custom Post Type?

How do I generate a feed for the following category? http://digitalxfiles.com/item-cat/wordpress/
The posts in this category comes from a "post-type" so I want to display a category feed from the post type. I tried using ths: http://digitalxfiles.com/category/webhosting/feed/ But it doesn't work.
You can get a feed from a single custom post type by using this link format: http://example.com/feed/?post_type=yourposttype. You can add additional queries onto that if needed to go deeper, like specific categories. So, if you have the item-cat post type and you have the wordpress category, with an id of 42, your link would be: http://example.com/feed/?post_type=item-cat&cat=42.

Linking tables in Drupal 7

I cant figure out how to link fields between 2 content-types in Drupal 7. For example...
I'm building an online shop using Drupal 7. There are several product categories and each category has its own page that displays all the products in that category plus a category description.
I store this data in two tables (content types). See below.
categories content-type:
category_name, description
----------------------------------------------
paintings, "A selection of paintings that we supply. Prices include ...."
ceramics, ....
jewellery, ....
.
products content-type:
name, category_name, price, ...
---------------------------------------------------
mona-lisa, paintings, £10,
necklace1, jewellery, £20,
necklace2, jewellery, £30,
.
The common field is 'category_name'. In the first table I define all the values for category_name and in the second table, each time I add a new product, I want to be able to pick one category to assign to the product. Does anyone know how to do this?
You can reuse fields between content types but you cant change the widget type (the 'categories' content-type needs free-text entry and the 'products' content-type needs a selector.
In Drupal 6 there seemed to be a 'node reference' field type which might be what I'm looking for but I cant figure out how to get this in Drupal7.
This module is still in progress but you can use references for that.

Resources