you can use
global $current_user;
get_currentuserinfo();
and then add
'post_author' => $current_user->ID
to your $new_post array.
then you can use
<p>Posted by: <?php the_author(); ?></p>
Related Posts:
- Remove Categories / Tags From Admin Menu
- Front-End Post Submission
- Setting Custom Sort Order of Posts within a Category
- Custom permalink structure only for default posts
- Exclude drafts in all() view of edit.php
- Is this the best (and only) option to style CSS for a given post type?
- Sort post by attributes ‘order’
- How to change the layout and styling of posts according to their category in WordPress?
- adding a custom css class to post
- Prevent duplicate posts in wp_insert_post using custom fields
- Add default content to post (for specific category)
- Pagination not working on Custom Page Template
- upload featured image from front end using wordpress add media button
- Add custom field to category of custom post type
- Display custom post types by date field
- How to hook a function only when I need to delete permanently a post?
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- user contributed content as custom post types
- Frontend Post Excerpt field mapping
- Remove custom posts that match taxonomy value
- Custom Theme Want To Remove One Category From All Displays
- Is there any WordPress alternative to Book module of Drupal?
- Post Type Label Name
- wp_query ‘s’ parameter does not work with custom post type
- How to start with post number x?
- Best way of deletion of old posts [closed]
- Sidebar links for different pages
- Deleted category by mistake, all posts now have categorized category. Can i revert that?
- Blog Posts in Custom Menu
- How to display data in archive page?
- Delete post by giving its link
- How to make classes for posts?
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- CPT archive redirects to single post
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Turn On Comments On Custom Post Types in Directory Theme
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- Automatically add date to the auto generation of post slug
- Duplicate Custom Post Type and Taxonomy Slug
- How could I change my Permalink from blog to custom structure? [closed]
- WP Admin register taxonomy and post type performance
- Adding an image to a non existing post
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Change Post Status From Front End
- How to allow visitors to filter posts by multiple taxonomies
- a little direction on custom post type
- Format latest/newest post differently
- relating business and products with custom taxonomy?
- Front end post submission form with duplicate type fields
- WordPress Query Posts From Category Post on Static Page
- Edit multiple custom post types while saving a new or edited post
- Create a custom posts page
- Replace image name on upload to the new post name on front-end form
- How to allow multiple thumbnail upload for Posts?
- add external project to web site wordpress on production
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- register_post_type permalink
- Custom Post Limit for homepage only without plugin?
- Static pages not working
- Can i have more than one form for front end posting in one template [closed]
- Change default post style to columns
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Adding a custom post type meta field to rss
- Help with listing current users submitted custom post type in template file
- Delete post from admin but not from database
- Custom Select Query – Selecting the Year?
- Deleting old posts
- How To Use Custom Tax of a Post Type
- What would causes search to return incorrect results?
- How to limit post (Exception pages) for current user in each role in front end?
- get posts, run a custom query, and join the results
- search form for custom fields
- Some custom post types did not return an object
- Display Post from Custom Post Type with Shortcode
- Tag for custom post type
- Modified core/image rendering not showing in posts – only on pages
- Not display an image of category of custom post
- Post relationships/nesting
- How to generate an HTML link automatically from URL in a users’ post
- Manual Scheduler For Custom Post Type
- Dev and prod on the same database- dev version active for IOS
- How to delete/customize imported demo content from a theme or add my own?
- Displaying dynamic content (blog posts/portfolio) on a static homepage and keep the blog post styles
- single- and archive- templates not being applied to custom post types, not even after flushing permalinks
- Multiple Custom Post Type loop logic
- WordPress search for specific Post Type
- How to show content of specific item on the same page?
- How to list all names and descriptions of a custom taxonomy
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Show a Category Specific Info Box
- Make a custom URL and link to custom Template
- Special Query: Title, Terms, Content – %LIKE%
- First Custom Post Custom Fields Empty After New Custom Post
- Create post from form with image
- WordPress 3.2 – Problem with WYSIWYG editors in a custom post type?
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- How to have more post in a page than in your home page
- How do I get content of custom post type through post ID
- WordPress Custom Post type csv exporter
- Edit Page button is gone