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

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.

Related

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

ACF meta key field displays Array when field is of "relationship" type in post grid plugin wordpress

In wordpress I have a custom post type (generated through the ACF plugin) of job offers which include several text fields (meta_key values) which the plugin "post grid pro" will display no problem. However, I have one field which is the agency that posted the job offer.
This is a relationship field and whenever I add this meta_key to the list of fields to display within each block of my grid it displays simply "Array".
I have tried creating my own shortcode to display this field but alas, this does not work.
There is a page in the site, written by one of the original developers, which lists the job offers. They have managed to display the title of the job agency in php with:
<?= get_field("agence")[0]->post_title ?>
I would like to be able to either write my own shortcode to display the agency title or somehow dynamically create a new meta_key for each job offer which contains automatically the name of the agency derived from the relationship field "agence".
Any help would be vastly appreciated.
Instead of using the relationalship ACF field type, use the one called "Post Object". As long as you don't enable "Select multiple values?" option this will only return a single post object.
This post lists the difference between the two field types. Basically, they both return post objects, but they have slightly different options, and relationship fields always returns the result in an array. You could technically use the relationship field and set the minimum and maximum number of posts to 1, but the post object field is the most appropriate one to use when you only want a single post.

WordPress Categories vs URL Structure

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?

Extra options for Custom taxonomies Wordpress

I have to add simple options to my custom taxonomy (genre) for each custom post included in that specific taxonomy.
Taxonomy name: Genre
Taxonomies: Blues, Jazz, Rock
Custom post name: Bands
Bands: Band One, Band Two Band Three, Band Four
So basically going to the Jazz taxonomy options, should give me options for the Jazz bands:
Band Two {text_field}
Band Four {text_field}
I'm not achieving this with Advanced Custom Fields so I guess I need to write it? Or is there a plugin to save my life? If not where should I start looking?
If what you mean is that you want to extend your custom taxonomy to have more fields that the default: Name, Slug and Description, you can:
Use a massive plugin like Pods, which allows you to do what you want to do and much more stuff. See their docs.
Use a simple plugin like Tax-Meta-class, intended just for that purpose, which does not add many (probably unnecesary) code.
Try to do it manually, like in this example.
Note that I have not used any of these, but I'd strongly suggest you to try the option 2.
EDIT
Actually, if you're already using Advanced Custom Fields plugin, it allows you to do what you're looking for!
You just need to create a new Field Group and set up the custom fields you want as usual. Then, in the box Location, you need to set a Rule like this:
Show this field group if Taxonomy Term ----- equals to -----
Genre
This way you have all the power of ACF to create select-boxes or whatever you need...
EDIT 2
If what you want is to have different custom fields in a Post, depending on the Terms that this post has for a given taxonomy, you have to set up a Rule for your Field Group like this:
Show this field group if Post Taxonomy ----- equals to -----
Jazz
This will display this Field Group in all the Bands with a value of Jazz in the Genre taxonomy...

How to dynamically create rss feed?

I just created my first rss feed. it worked fine. got it validated. It is basic feed of my recent blog posts. I would like to know if i would dynamically url parameters..
feed would look like this .. http://www.website.com/feed/?category=php.rss...
should show the recent blog posts of category "php". if category changes to "jquery" should show recent posts in "jquery"
How can I build a feed with changing URL parameters or build individual feeds?
Of course.
Just get the category name of out of the query string (using whatever standard library you use for that in whatever language you are using), add that as a conditional to whatever method you use to get the data (hopefully some sort of ORM), then drop the results into whatever library you generate the RSS from, just as if it were all the entries.

Resources