How to add WordPress custom posts by front end forms - php

I have created a custom post type named gallery and its showing up nicely and works fine for me. My problem is that I don't want to allow my users to post their galleries from dashboard I want a way so that they can post there gallery images from front end by using upload buttons or any thing like forms etc. Is this possible to achieve in WordPress?
Kindly guide me in this regard, or is there any plugin which can do this task for me?

You can set and retrieve custom fields in code, either using custom metaboxes or a plugin like Advanced Custom Fields or Pods
You can set capabilities when you register a post type to control what roles can access what.

Related

In wordpress, is there a way to add posts as drafts from the main site, not the admin panel?

Have to make something so anybody can add something in the form on the public site, then admin in admin panel will publish it. The post will be a custom type with custom fields and post thumbnail.
So like in a title. Is there a way to make it happen in WordPress?
Found function *wp_insert_post* but how to make it work for nonregistered users, also how to upload a picture and add it to post?
Ok, I found the way to do that.
Simply use 'Contact Form 7' and plugin 'Post My CF7 Form', create frontend form in CF7 and map it to custom post type. Needed to do some changes in code but works like charm.
For this, I would recommend a plugin called Formidable Pro. With formidable pro, you have the ability to put a front-end form on a website that allows users (logged in or not, depending on how it's setup) to create posts with form submissions.
In the form, you would add fields for all relevant parts of the post (custom fields, title, picture upload, body copy, etc...) then in the settings of the "make post" function in Formidable Pro, attach all the relevant fields to the post content areas (featured image, title, custom fields, etc...).
Formidable Pro can be purchased and downloaded via formidablepro.com (unfortunately the create post feature is a paid-only feature).
Here is their help desk article on creating posts from entries: https://formidableforms.com/knowledgebase/create-posts/

Need Seprate Category Page for custom post types

I have created a custom post types(passion) and i am using built in categories for it.
Please note that i am also using built in posts for home page which is working fine, it has its own category,archive page.
"Passion" post type is for paid user. My custom posts are working fine. But i am unable to create a category page for "passion" post type so that if user goes to url
"www.site.com/passion/dance" it shows all the "passion" custom posts with "dance" category. I am using WCK plugin to create post types.
I have tried creating archive-passion.php,category-passion.php, taxonomy-passion.php files but nothing worked.
Use http://domain.com/category/dance/?post_type=passion for CPT and add custom code in your archive-passion.php

How to display a wordpress custom post?

Okay, so I am completely lost on how to display a custom post. I've looked everywhere and can't seem to wrap my mind around it.
So, I downloaded the plugin Custom Post Type UI to create a custom post. Here are the parameters of my custom post type:
Name: discount
Label: Discount
Supports:
title,
excerpt,
thumbnail,
author
Then, I downloaded Advanced Custom Fields to give my custom post types some custom fields for users to edit.
I didn't have any problems with that. My problem is that I have no idea how to implement this into my site. I would like it to act exactly like a blog post and also implement a masonry for it - just like my blog posts (I'm using the dante theme (I can't post any more links)).
If anybody could help me out with this, or send me in the right direction, I would be so greatful. Thanks!
Your custom post type's theme template would be called "single-[post type name].php".
So for your example, you would want to create single-discount.php if your theme's root directory. Then you can start pulling your data from the posts through that.
For Advanced Custom Fields, you'll want to get familiar with get_field() and the_field(). ACF has great documentation on their site for how to use the various field types (http://www.advancedcustomfields.com/resources/)
To answer your questions in a general way, you could start by:
Theme Development. To understand how a WP theme works
Template Hierarchy. To understand what are the template files and how they are managed by WP
The Loop. To understand how WP shows the post
WP Query Class. To understand how to manage the posts, perhaps in the case of custom post type
For the custom fields, #Joe has pointed you in the right direction.
Hope it helps!

how to create custom field to custom page type in wordpress

I am trying to develop one page portfolio wordpress theme .I have a custom post type, called "portfolio". Every posts from portfolio will be displayed in a custom template name portfolio-tempalte. Its my psd of the template.
http://s29.postimg.org/g4g7pr307/ask.png
1st post from custom post type will be displayed at the top, then 2nd post will be displayed at the bottom of 1st post. And it will be going on like this way. But the problem is, if you see my psd template there are completely different background color in different posts . I want to be able to define background color based on users hex color code input.
To do this I have decided to use custom field. Although I dont have enough knowledge about custom field.
So I need help , how to add custom field to custom post type in wordpress. If it is not possible with custom field then please suggest me how to do that.
Try this ,
http://wordpress.org/plugins/advanced-custom-fields/
Advanced custom fields. Hope this helps you

Simple page ordering on regular posts

I´m trying to use the simple page ordering plugin on wordpress.
I get the drag & drop interface on custom post and pages but it seems that it doesn´t work with regular posts. Does anybody knows a fix to make it work with the normal wordpress posts?
http://wordpress.org/extend/plugins/simple-page-ordering/
Ordering only applies to PAGE post type or those custom posts which are of PAGE type.
POST post type donot use ordering so the plugins also dosen't work with them

Categories