Jump to content


Photo
Accordions

Accordions Custom Post Type



Best Answer ellenmva , 27 December 2013 - 03:36 PM

@abielski Great, the plugin author added a filter so we can add the placcordions post type.

 

You will need to add this to the functions.php file in your child theme. If you are not using a child theme, here is a blank DMS Child Theme.

 

Now, add this code to the theme and you should be all set.

 
function add_placcordions_cpt() {
	
	$args = array(
			'type' => 'placcordion'
	);
}

add_filter('pts_post_type_filter', 'add_placcordions_cpt');

Let me know if that works.

 

Best, 

Ellen

Go to the full post


  • Please log in to reply
5 replies to this topic

#1 abielski

abielski

    Newbie

  • Members

  • 9 posts
  • Country: Country Flag

Posted 27 December 2013 - 02:53 PM

I have recently installed the Accordions section into my DMS. When I add a new Accordions, it works fine, but as soon as I edit it, it saves it to "Posts" instead of the "placcordions" custom post type. There is no post type called accordions in the drop down list, which is why it is acting that way. I have WordPress 3.8.

 

Thanks,

Amy

 

 

Attached Files



#2 abielski

abielski

    Newbie

  • Members

  • 9 posts
  • Country: Country Flag

Posted 27 December 2013 - 02:55 PM

Also when I move the default accordions to the trash, they immediately re-appear in the main list.



#3 ellenmva

ellenmva

    Advocate

  • Members

  • 290 posts
  • LocationMassachusetts
  • Country: Country Flag

Posted 27 December 2013 - 03:09 PM

@abielski I'm not sure what plugin is giving you that dropdown list. That's not something that is part of DMS or Accordions.

 

Let me know what the plugin is that is creating the drop down so I can reproduce the issue. I have a feeling it is something to do with the PageLines function that creates the custom post type. In the next version I am using the WordPress function which should fix the issue. But, let's make sure that is the issue.

 

Thanks,

 

Ellen



#4 abielski

abielski

    Newbie

  • Members

  • 9 posts
  • Country: Country Flag

Posted 27 December 2013 - 03:12 PM

Post Type Switcher



#5 ellenmva

ellenmva

    Advocate

  • Members

  • 290 posts
  • LocationMassachusetts
  • Country: Country Flag

Posted 27 December 2013 - 03:36 PM   Best Answer

@abielski Great, the plugin author added a filter so we can add the placcordions post type.

 

You will need to add this to the functions.php file in your child theme. If you are not using a child theme, here is a blank DMS Child Theme.

 

Now, add this code to the theme and you should be all set.

 
function add_placcordions_cpt() {
	
	$args = array(
			'type' => 'placcordion'
	);
}

add_filter('pts_post_type_filter', 'add_placcordions_cpt');

Let me know if that works.

 

Best, 

Ellen



#6 abielski

abielski

    Newbie

  • Members

  • 9 posts
  • Country: Country Flag

Posted 28 December 2013 - 09:34 AM

That worked. Thanks



Also tagged with one or more of these keywords: Accordions