custom post types not showing.

I have 3 different custom post types in my wp install and I figured out how to show the custom fields fine with the theme I have. Along with the theme I created I also have templateer which allows extra theme options and page templates.

The problem I am having is that when i choose a page template, 1 of the options is to be able to choose a category from posts.

none of the custom post types show up in this list only the uncategorized category from the default posts section.

Here is the code from the page template file.

[code]
<?php

/*

Template Name: Magazine 1a

*/

?>

<?php

get_header();

include get_template_directory()."/includes/tt_meta.php";

global $custom_metabox_mag1;

$meta_test1 = $custom_metabox_mag1->the_meta();

$home_page_sheet_style = $meta_test1['home_page_sheet_style'];

$hp_widgetized_position = $meta_test1['hp_widgetized_position'];

$hp_top_margin_choose = $meta_test1['hp_top_margin_choose'];

$hp_top_margin_t = $meta_test1['hp_top_margin_t']; if ($hp_top_margin_t == '') $hp_top_margin_t = 0;

$hp_top_margin_r = $meta_test1['hp_top_margin_r']; if ($hp_top_margin_r == '') $hp_top_margin_r = 0;

$hp_top_margin_b = $meta_test1['hp_top_margin_b']; if ($hp_top_margin_b == '') $hp_top_margin_b = 0;

$hp_top_margin_l = $meta_test1['hp_top_margin_l']; if ($hp_top_margin_l == '') $hp_top_margin_l = 0;

$hp_top_margin = $hp_top_margin_t.'px '.$hp_top_margin_r.'px '.$hp_top_margin_b.'px '.$hp_top_margin_l.'px' ;

$hp_widgetized_show = $meta_test1['hp_widgetized_show'];

$home_page_top = $meta_test1['home_page_top'];

$home_page_widget_size = $meta_test1['home_page_widget_size'];

$home_page_widget_style = $meta_test1['home_page_widget_style'];

$title_change = $meta_test1['title_change'];

$title_length = $meta_test1['title_length'];

$m1_h2_change = $meta_test1['m1_h2_change'];

$m1_h2_size = $meta_test1['m1_h2_size'];

$all_cats = $meta_test1['all_cats'];

$m1_cat = $meta_test1['m1_cat'];

if ($all_cats == 'Yes') {$m1_cat = '';}

$m2_img_height = $meta_test1['m1_img_height']; // image height

$m2_img_width = $meta_test1['m1_img_width']; //image width

$m2_content_length = $meta_test1['m1_content_length']; // length of content in characters

$m1_totalposts = $meta_test1['m1_totalposts']; // Total number of posts to display per page

$m1_contentheight = $meta_test1['m1_contentheight']; // height of content box in pixels

$m1_heading_text = $meta_test1['m1_heading_text']; // text in the title for the header above posts

$m1_header_text_include = $meta_test1['m1_header_text_include']; // display header above posts (or not)

$m1_block_transparent = $meta_test1['m1_block_transparent']; // make background color of art-block transparent

$m1_block_padding_choose = $meta_test1['m1_block_padding_choose'];

$m1_block_margin_choose = $meta_test1['m1_block_margin_choose'];

$m2_style = $meta_test1['m1_style'];

$m1_block_padding_t = $meta_test1['m1_block_padding_t']; if ($m1_block_padding_t == '') $m1_block_padding_t = '0'; $m1_block_padding_r = $meta_test1['m1_block_padding_r']; if ($m1_block_padding_r == '') $m1_block_padding_r = '0'; $m1_block_padding_b = $meta_test1['m1_block_padding_b']; if ($m1_block_padding_b == '') $m1_block_padding_b = '0'; $m1_block_padding_l = $meta_test1['m1_block_padding_l']; if ($m1_block_padding_l == '') $m1_block_padding_l = '0';

$m1_block_padding = $m1_block_padding_t.'px '.$m1_block_padding_r.'px '.$m1_block_padding_b.'px '.$m1_block_padding_l.'px' ;

$m1_block_margin_t = $meta_test1['m1_block_margin_t']; if ($m1_block_margin_t == '') $m1_block_margin_t = 0; $m1_block_margin_r = $meta_test1['m1_block_margin_r']; if ($m1_block_margin_r == '') $m1_block_margin_r = 0; $m1_block_margin_b = $meta_test1['m1_block_margin_b']; if ($m1_block_margin_b == '') $m1_block_margin_b = 0; $m1_block_margin_l = $meta_test1['m1_block_margin_l']; if ($m1_block_margin_l == '') $m1_block_margin_l = 0;

$m1_block_margin = $m1_block_margin_t.'px '.$m1_block_margin_r.'px '.$m1_block_margin_b.'px '.$m1_block_margin_l.'px' ;

$show = $meta_test1['show'];

$feat_img = $meta_test1['feat_img'];

$hp_mid_image_shadow = $meta_test1['hp_mid_image_shadow'];

$img_pos1 = $meta_test1['img_pos1'];

if (is_paged()) $is_paged = true;

?>

<style type='text/css'>

.art-post ul li, .art-post ol ul li {overflow:visible;}

<?php if ($hp_top_margin_choose == 'Yes'&& $home_page_widget_size == 'home_page_header_wide') { ?>#home-top-bg {padding: <?php echo $hp_top_margin ; ?>;}<?php } ?>

<?php if ($hp_top_margin_choose == 'Yes' && $home_page_widget_size == 'home_page_header') { ?>.home-top-left {padding: <?php echo $hp_top_margin ; ?>;}<?php } ?>

.mini-post {float:left;overflow:hidden;width:50%;}

<?php if ($m1_h2_change == 'Yes') { ?>

.mini-post .art-post h2.art-postheader, .mini-post .art-post h2.art-postheader a, .mini-post .art-post h2.art-postheader a:link, .mini-post .art-post h2.art-postheader a:visited, .mini-post .art-post h2.art-postheader a.visited, .mini-post .art-post h2.art-postheader a:hover, .mini-post .art-post h2.art-postheader a.hovered {font-size:<?php echo $m1_h2_size; ?>px;}

.mini-post .art-blockheader h3.t a, .mini-post .art-blockheader h3.t a:link, .mini-post .art-blockheader h3.t a:visited, .mini-post .art-blockheader h3.t a:hover {font-size: <?php echo $m1_h2_size; ?>px;} <?php } ?>

.mini-post .art-block a:link,.mini-post .art-block a:visited {text-decoration:none;color:inherit;}

.mini-post .art-block img {float:left;<?php if ($m1_block_margin_choose == 'Yes') { ?>margin:<?php echo $m1_block_margin ; ?>;<?php } ?>}

<?php if ($m1_block_padding_choose == 'Yes') { ?>.mini-post .art-blockcontent-body {padding:<?php echo $m1_block_padding ; ?>;}<?php } ?>

.mini-post .art-blockcontent-body {height: <?php echo $m1_contentheight.'px;' ; ?>px;}

<?php if ($m1_block_transparent == 'Yes') { ?>.art-content-layout .art-content .mini-post .art-block {background-color:transparent;}<?php } ?>

.mini-post .art-post img {float:left;<?php if ($m1_block_margin_choose == 'Yes') { ?>margin:<?php echo $m1_block_margin ; ?>;<?php } ?>}

.mini-post .art-postcontent {height: <?php echo $m1_contentheight.'px;' ; ?>px;}

<?php if ($m1_block_padding_choose == 'Yes') { ?>.mini-post .art-postcontent p {padding:<?php echo $m1_block_padding ; ?>;}<?php } ?>

</style>

<!--[if IE ]><style type="text/css">.mini-post {width:49.9%;}</style><![endif]-->

<?php global $this_post_id; $this_post_id = $post->ID;

top_widget_print('in');

if ( theme_get_meta_option($post->ID, 'theme_show_home_widget') && !theme_get_meta_option($post->ID, 'theme_show_home_widget_pos')){home_page_widget($size);}

?>

<?php

if (!is_paged()) {

if ($show == 'Yes') {

while (have_posts()) {

the_post();

get_template_part('content', 'minimum');

}

}

} ?>

<?php

$temp_query = clone $wp_query;

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

$wp_query = new WP_Query('cat='.$m1_cat.'&showposts='.$m1_totalposts.'&paged='.$paged);

while($wp_query->have_posts()) : $wp_query->the_post();

?>

<?php //$wp_query = new WP_Query('cat='.$m1_cat.'&showposts='.$m1_totalposts.'&paged='.$paged); while($wp_query->have_posts()) : $wp_query->the_post();?>

<div class="mini-post">

<?php

global $post;

if ($title_change) {

if (strlen($post->post_title) > $title_length) {

$post_title = substr(get_the_title($before = '', $after = '', FALSE), 0, $title_length) . '...'; } else {

$post_title = get_the_title();

} } else { $post_title = get_the_title(); }

$m2_style(

array(

'id' => theme_get_post_id(),

'title' => 'ID ) . '" rel="bookmark" title="' . get_the_title() . '">' . $post_title . '',

'class' => theme_get_post_class(),

'content' => tt_get_content_all(

array(

'feat_img' => $feat_img,

'image_width' => $m2_img_width,

'image_height' => $m2_img_height,

'img_pos' => $img_pos1,

'img_shad' => $hp_mid_image_shadow,

'content_length' => $m2_content_length

)

)

));

?>

</div>

<?php endwhile;?>

<div class="cleared"></div>

<?php theme_page_navigation(); $wp_query = clone $temp_query; ?>

<div class="cleared"></div>

<?php global $this_post_id; if ( theme_get_meta_option($this_post_id, 'theme_show_sb_bot') && !theme_get_meta_option($this_post_id, 'theme_show_sb_bot_wide') ) {get_sidebar('bottom');} ?>

<?php get_footer(); ?>
[/code]

what would I need to add to this to be able to choose from the custom post types?

  • Arnold

    If I understand you correctly, your talking about the "Page Attribute" template, not a theme template? You are also working in the "page" post type?

    Your theme appears to be a generated theme from Artisteer. It's not a standard theme, it's custom made for your site?

    Your Templateer is also an Artisteer product?

    I don't have access to any of these which makes it hard to test anything,

    On your site I don't see anything for picking a category except the filter on the Custom type lists.

    So basically I can't figure out what your trying to do or where your trying to do it.

    You say "none of the custom post types show up in this list only the uncategorized category from the default posts section."

    Why would a list for displaying categories show post types? If your talking about custom taxonomies tehy are limited to the post types they are associated with, The wouldn't show on a template display "page" post type posts.

    I need a clear explanation of what your trying to do and where your trying to do it. Avoid code until I know what your looking at in the interface.

  • tfbc

    how come the post types that come with wordpress appear fine in a page attribute template but the custom post types do not.

    when I make custom post types, taxonomies, when i goto the menu i can choose from the categories or individual posts of those custom ones.

    but the page attributes do not show those categories or custom post types.

    i added screenshots of a page edit and what it shows.

    as you can see there only uncategorized shows up. So i need to know how does custompress link to pages.

    the theme is artisteer generated and templateer is the theme options which gives it all the page attributes. I already talked with the templateer support and they are not sure how the custompress part works neither.

    If you want I can send a copy of the wordpress theme to test with.

  • Arnold

    In the custom types > supports you have Page Attributes checked, but the note there tells you that such have to have Hierarchicak set as well, which it wasn't. I set it on your Adoption post type and the Parent shows up. Template doesn;t show up because you probably haven;t made any for that post type. To make temlpates you need to add some headers

    http://wordpress.stackexchange.com/questions/1577/adding-a-template-to-the-page-attributes-panel-for-both-posts-and-pages

    Also if you are editing on the Page editor, note that "page" is a custom post type that is predefined. There no reason code designed for handling the "page" post type would respond to any other post type unless it's programmed.to do so. Here's an example

    http://wp.tutsplus.com/tutorials/widgets/using-custom-post-types-to-create-a-killer-portfolio/

    Now the drop down your trying to get won't appear on anything but "page" post types
    It specifically checks on the core code.

    if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) {
    		$template = !empty($post->page_template) ? $post->page_template : false;
    		?>
    <p><strong><?php _e('Template') ?></strong></p>
    <label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
    <option value='default'><?php _e('Default Template'); ?></option>
    <?php page_template_dropdown($template); ?>
    </select>
    <?php
    	} ?>

    So it's not going to appear on the Custom type edit pages. That's why they call them "Page" Templates.

  • tfbc

    the templates show up fine under page attributes, the issue im having is that within those templateer page templates they only pull the categories from wordpress's post categories not the custom post type categories.

    I look under custompress under taxanomies

    adoption_categories is set yes for Hierarchical and Hierarchical URLS.

    So the templates only seem to pull the regular taxonomies not custom ones.

    I dont want these templates to be selectable within each post type at this time.
    the template was designed to make a Page(static) and include content from the different Post Categories along with custom content I want on that static page.

    So maybe Im missing something here...

  • Arnold

    So the templates only seem to pull the regular taxonomies not custom ones.

    "page" is a post type Your on the "page" editor. Associated with "page" are two Taxonomies, "categories" and post_tags". "categories" is hierarchical, "tags" is not. So "page" is Only going to show those two taxonomies.

    The builtin "categories" and "tags" are associated with "post" and "page" post types.

    "adoptions" is a custom post type you've created.. You've associated "adoption_categories" taxonomy with it. While it's called a category because it acts like a category being hierarchical, it's just a taxonomy separate from WP "categories" . You've created no association to "page" posts.

    You can associate the custom taxonomies with both "page" and "adoption_categories" The Adoption categories can then be set on "page" post types.

    Now, is your Templeteer smart enough to handle more than one taxonomy? It appears not. I set both "page" and "adoption_categories" on your "page" post type and the Templeteer doesn't see it. I do see the WP meta box for Adoption Categories in the page editor. For example do a Quick edit on an Adoption post now. So the limitation is you Templeteer program.

    Artisteer needs to be able to handle multiple taxonomies and all that implies to do what you want if you want to work through their program.

    Note that doing it this way would not retrieve any "adoptions" post type posts if you set them on "page" type posts.

    If you can get away from Artisteer there are some ways you can progrm what you want. You can create a named Template and in the template change the query to actually use an entirely different post type and args. But you have to program it, Not trivial. And I don't see much advatage because oyu could write custom templates to do the same for the same amount of work without having to override the queries.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.