Support » Theme: P2 » [Theme: P2] Feature request: setting default post type

  • I know this has been raised before on a number of occasions, and various hacks have been posted to enable this, but could consideration be given to including a way in the theme options to set the default post type (eg from Status Update to Blog Post) in the next version of P2?



Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Peter Westwood


    WordPress Lead Developer

    Hacky but “works for me” in a mu-plugin / child theme functions.php workaround:

    function p2_use_blog_posttype() {
    	if ( p2_user_can_post() && !is_archive() && is_front_page() )
    		if ( !isset( $_GET['p'] ) )
    			$_GET['p'] = 'post';
    add_action( 'wp_head', 'p2_use_blog_posttype' );

    Westi, that works – but as you told me in another place, you need to copy the P2 inc subdirectory to the P2 child theme.

    However, my point about building the option to set the default post type into the next version of P2 still stands.

    I can’t find the function listed above. I’m on p2 version 1.4.0. Has something changed?

    Anyway, I just spent three incredibly frustrating hours trying to make Blog Post the default post type on my site. I’ve scoured this forum, found many threads addressing the issue, but not yet found a 100% working solution.

    I’m not an advanced PHP or Javascript programmer but I don’t mind hacking around. I just don’t know enough to solve this riddle without help.

    I tried every “fix” listed in these forums. I even tried modifying my child theme so that the four post type options are gone, and blog post is the only option available. No matter what I do, I can’t find a way to prevent p2 from assuming I want to submit a status update!

    I will buy lunch and a beer for anyone who can provide a 100% working solution. Don’t really care if it’s a plugin, or instructions for a hack, or modifying the p2 theme… anything to help us folks who don’t want Status Update as the default mode, and who just want to use Blog Posts with p2.



    Did anyone find a solution? We simply hacked the tabs, and removed the option for the others… But now to apply it again in the newest version yet. Please consider making this a checkbox P2 folk. A default or way to disable others would be SWEET within the admin! Adding Peter’s hack appears to work as well.

    I’m using this snippet of code in a JS file loaded from a child theme:

    (function($) {
     $(document).ready(function() {
             var defps = setTimeout(function(){
                    $('#post-types a#post').trigger('click');

    hacky but works without problems

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Theme: P2] Feature request: setting default post type’ is closed to new replies.