Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A custom post type is exactly that - a custom post type. Wordpress uses regular, built-in posts to display in the blog portion of a website. You create them in the 'posts' button you see in the backend. So what you did was add a new, custom post type. That creates a new button with label 'int'. But the types of input will be the same as a regular post type - you'll see the tinyMCE box, apply category/tag, etc.</p> <p>I think that apart from a custom post type, what you need are custom fields as expressed on your image. An easy and convenient way to deal with those would be to use this plugin: <a href="http://www.advancedcustomfields.com/" rel="nofollow">http://www.advancedcustomfields.com/</a></p> <p>Or, if you don't really need a custom post type - which will maybe make your loops slightly harder since you'll have to filter what gets queried in order to get what you really want each time - maybe you could do on custom fields alone.</p> <p>If you need the user to have only a couple input boxes, no tinyMCE etc though, I'd say you'll need both custom types and custom fields.</p> <p>Edit: more info about custom post types here: <a href="http://codex.wordpress.org/Post_Types" rel="nofollow">Post Types &laquo; WordPress Codex</a></p> <p>and custom fields here: <a href="http://codex.wordpress.org/Custom_Fields" rel="nofollow">Custom fields &laquo; WordPress Codex</a></p> <p><strong>EDIT:</strong> If the user will enter these 2 'inputs' every time they post something, that is, if those 2 snippets will exist in a per post basis... I think you are definitely looking for the functionality custom fields give. Forget about custom post types. Simply create custom fields and retrieve them through the theme like so, in a single post loop:</p> <pre><code>$themeta = get_post_meta($post-&gt;ID, $keyOfTheValueYouWantToRetrieve, TRUE); if($themeta != '') { // show that info as desired echo "I want to" . $themeta; } </code></pre> <p>I'm still not sure if that's what you meant though :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COThank you very much for the time you took to answer me! I have already looked into the Post Types info in the Codex, and I've read it over and over again but there's a brain block occuring, I just don't 'get' it. As I understand it, the custom fields are created on a post-to-post basis - see, I don't get how I could create custom fields (meta-data) on the fly and attach these to the post, and retrieve these custom fields, in order at that. I'm stuck!
      singulars
    2. COThink of custom post types just as a means to organize different type of posts. They're related to custom taxonomies, if you will. But that's another topic altogether. Imagine you are an artist that wants both a blog and a showcase of your work in the same site. While you could filter your queries depending on the categories applied to a post, it makes more sense to create a new custom post type and separate content types. So you'd have the built-in 'post' type for your blog posts, and a custom post type called 'portfolio' for example, which you'd use for each new art piece you upload.
      singulars
    3. COI understand the basic concept behind custom post types, but I don't know how to use pre-existing infrastructure to manage custom fields - I'm worried I'll have to use custom tables. I'm OK with that, I've made a project using custom tables already, but only because I didn't understand how to use the pre-existing infrastructure to make the project work.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload