Multiple Part Wordpress Post - wordpress

I want to create a blog with stories. Where each story may have multiple chapters. I want to publish chapter wise. Is there any plugin to handle this in WordPress?

You could use core functionalities like categories or even tags as the root of your stories and publish each chapter as new post in this category or with the assigned tag.
Then you could display your stories on an archive page with a custom loop, depending on how/what you want to display (eg. title, content, excerpt...).

You can do this with the Custom Post Type. Here is the plugin you may use.
https://wordpress.org/plugins/custom-post-type-ui/
You can set your Stories as Custom post type and Chapter as a Custom taxonomy. You can also call them on any page, sort them as your chapter vise, you can also show limited chapters stories, etc. with the WP_Query.
https://developer.wordpress.org/reference/classes/wp_query/

Related

Wordpress custom post type single as parent for archive

For a new project i like to have a single of my custom post type 'teams' as a parent of a custom post type archive and singles 'report' so i would like to have "Teams/{team-name}/reports/{report}".
I've tried to create a custom slug with the 'save_post' action/hook but it didn't work. On the editor page of a report i do have a custom field to select a team but ik look likes this is not usable on the save_post function yet. Does anyone have a suggestion?
Based on what you've indicated in the comments above, I'd be inclined to do away with the http://{website}/Teams/{team-name}/reports/{report} pretty URL and have a more simple http://{website}/Teams/{team-name} URL. It will be more intuitive to remember for visitors.
In the single for the Team CPT, you would include a loop for the archive type associated with the particular team. You COULD create a hierarchy of CPT where Reports are a child of Team but you will be heading down a slippery road that the parent/child relationship creates a lot of overhang when the types become populated.
There are a lot of threads about this, this is just one guys report on what happens when there are many hierarchical CPTs: https://wordpress.org/support/topic/hierarchical-post-type-w-heavy-data-set-fails-lots-of-custom-fields?replies=1
If you could create them as individual (non related) CPTs, and have a common category or taxonomy you could then in the single.php of your CPT include a loop for the archive, or alternatively in the archive for the reports, you could include a team header section. You could link the two on that taxonomy.
On a slightly different tact, if it is just some basic info you want to have about the team on the archive page, you could include a description in the reports taxonomy and depending on your theme (or custom coding) you could display that at the top of the reports archive.

Wordpress: Using Custom Post Type for image list of Product

I have a Wordpress-blog with gift ideas where I write text based articles. I recently discovered Custom Post types which I believe is the solution to an feature I want to create.
What I want:
Be able to tag each custom post using the normal "Categories" and "Tags".
Create a 3x3 matrix with product images (custom posts) to be shown on top of each Category-view or Tag-view (followed by the typical article list in the category or tag).
Example:
Lets say I have a category "Gifts for mom" and tags "Pink", "Cheap"
In the category "Gifts for mom" I have 10 text articles (normal posts) discussing the difficulties of buying gifts for your mom
I create nine custom posts, each is a specific gift (e.g. A pink hairbrush). I want to place them in the Category "Gifts for mom" and tag them with "Pink".
When I view myrandomgiftblogname.com/category/gifts-for-mom I want to be able to get a view:
Gifts for mom
Product Product Product
Product Product Product
Product Product Product
Articles:
- This awesome article
- That awesome article
- Etc
I assume this is possible but don't really know where to begin. Could you point me in the right direction? Which Plugins do I need? Do I need to do any programming myself (or just plugin configuration)? Is this even possible?
The description is a bit broad, hence a bit broad answer.
Two things are needed:
1) A plugin to create the Custom Post Type.
It is considered best practice to let CPT's in Plugin territory. So you can swap designs and preserve your CPT functionality. In reality, you are asking for future problems letting this be handled by the theme.
Create your own plugin, which would contain a register_post_type and any extra configs.
Use an existent plugin, like Custom Content Type Manager.
Its Custom Fields features are quite handy as well.
Allows users to create custom content types (also known as post types) and standardized custom fields for each, including dropdowns, checkboxes, and images.
2) Learn how to use and customize WordPress Templates
http://codex.wordpress.org/Templates
Templates are the files which control how your WordPress site will be displayed on the Web. These files draw information from your WordPress MySQL database and generate the HTML code which is sent to the web browser. Through its powerful Theme system, WordPress allows you to define as few or as many Templates as you like all under one Theme. Each of these Template files can be configured for use under specific situations.
You can try the following:
Add a new Page for each category with the exact same name as the category.
In the Images menu attach to each of those pages the images you want.
In your script query for a page with a name identical to the current category, and pull all of its attachments

Link pages to custom post types

I have a WooCommerce site which has a custom post type named 'products'.
Each product is associated with 1 or more technologies which I have detailed in a set of pages. There are 8 pages in all, one for each technology. The pages are accessible in a "Technologies" menu on the site.
I want to be able to link products and technologies so that I may call up the linked pages on product pages. I will have a technologies section where I will list the technologies, the key image and excerpt. The thing is, every product uses different technologies.
What I have imaged as a solution is a way to link the pages to the product much like I would link categories. Then on the product page, I can get the attached pages to that product.
From what I understand from your question, the answer is available at the Wordpress codex. If this is not the case, you probably have to formulate your question better.
From that page from the codex, you can pick up a line as simple as this one:
<?php wp_list_pages('post_type=yourcustomtype&title_li='); ?>
I've found a very useful plugin called "Advanced Custom Fields"(http://www.advancedcustomfields.com/) which allows this. With this plugin, you can create Relations between a post and other posts/pages.
Then in you post, you can call up the related post objects and pull all the information you like from them.

Wordpress - Best way to differentiate between Blog Posts and News Posts

I am implementing a clients website in wordpress that has both news and blog posts. The homepage is satic page but the nav bar has the links to two different types of posts - NEWS AND BLOGS. Though both are exactly same however they are to be made accessible entirely separate from each other through the navigation bar.
Now I would like to know what is the best possible way to differentiate between the two in the admin panel:
I mean i can create custom post types for either one or for both the types or on the other hand create no custom post type but just a taxonomy to divide the two into different parts as news posts and blog posts. Also I think I can use the custom field option to differentiate between the two...
Kindly keep in mind that the news and blog posts will be made by the client himself...
Going with this train of thought
Kindly keep in mind that the news and blog posts will be made by the client himself
I think that the best option would be to create a custom post type for "news" and leave the standard blog posts unchanged.
As you can see in the official documentation. Once you create a custom post type, a new top-level option will be created in the admin panel.
Which would allow for the following use scenarios:
Posts > Add New
Posts > All Posts
News > Add New
News > All News
Keeping the taxonomies out of this is also a good idea. Because that would allow you to keep them meaningful and share them among different post types.
e.g: clicking on "open source" category would show a list of "posts" and "news" related to that particular topic.
This yoast article covers a few more advanced scenarios and how to manage them.
Using custom-fields would probably confuse the end user. Especially because there will be times where they forget to add the field altogether, and wonder why the post is not showing on the page at all.
hope this helps
J

Linking Custom Post Types in Wordpress?

I have three Custom Post Types in Wordpress: artists, writers, stories
Is it possible to "link" the posts? For example, if a story is written by a writer and illustrated by an artist, I would like to show in the story page a picture of the writer (linked to the writer's page) and other stories illustrated by the artist.
Use the Posts 2 Posts Plugin
It gives you the chance to make relationships between post types.
I used it to link Clients to Projects and it worked like a charm.
P.S.: The answer given earlier will be needed to, you will need to make templates to display this all.
You probably want a custom single page template.
Adding a new template for those post types is easy. You can add a new template for each post type, like "single-artist.php" in which you put together the page to display the artist info. On the "single-story.php" you can arrange it so that the appropriate links are added where necessary.

Resources