This topic has 3 replies, 2 voices, and was last updated 8 years by Klame.

  • Author
  • #79517
     Klame
    Participant

    Hi,

    I’m trying to make custom post type with Kleo.
    I have created a code in functions.php, and it’s shown in the dashboard whit meta-boxes etc.

    But how do I get the data shown in front-end – On a subpage/page template?

    I tried to take a existing page-template from kleo, added it to child-kleo/page-templates, and added this code:

    COPY CODE
    <?php
    	$args array ('post_type' => 'coevents');
    	
    	$query = new WP_Query($args);
    		while($query -> have_posts()) : $query -> the_post();
    	?>
    	
    	<div class="event-titel">
    	<h2><?php the_title(); ?></h2>
    	</div>
    	<?php endwhile; ?>

    But then I get a PHP-error, seems like it dosen’t like the array…

    Furthermore this custom post type should be what the user creates, when he goes under “my articles” (using social articles plugin)
    Have looked/googled at this part so much yet, that I want the front-end done first.
    Is this simple to accomplish?

    #79545
     sharmstr
    Moderator

    I dont think Social Articles supports CPTs. I could be wrong. If not, take a look at this one: http://buddydev.com/buddypress/reintroducing-buddyblog-supporting-custom-post-typestaxonomies-for-buddypress-user-blogs/

    As far as templates go… not sure why you’re creating a page template. Looks like you just want a listing of all the posts for that CPT. If that’s the case, then you want to copy /kleo/archive.php to /kleo-child/archive-{cpt-name}.php

    Then, if you want a custom page to display that actual post, then you can do the same with single.php.

    Its all in the codex: https://codex.wordpress.org/Post_Type_Templates

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #79569
     Klame
    Participant

    Aaahhh okay! I see now. Thanks for the quick reply!

    #80248
     Klame
    Participant

    And buddyblog seems to do the trick 😉

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?