• dishditty

    (@dishditty)


    When using the wptouch plugin, I can ‘Enable custom post-type support’, but when I try to choose a custom post type that was added from my theme, it does not stay selected and the custom post does not show up on the mobile site. If I select a custom post type from a plugin, it works fine.

    I read on another forum post that I could just re-register the custom post type in the functions of the wptouch plugin, but I tried and it still did not work. Could you tell me the exact file location to register the plugin? This is the registration code used in the theme:
    $labels = array(
    ‘name’ => __(‘Recipes’, ‘FoodRecipe’),
    ‘singular_name’ => __(‘Recipe’, ‘FoodRecipe’),
    ‘add_new’ => __(‘Add New’, ‘FoodRecipe’), __(‘Recipe’, ‘FoodRecipe’),
    ‘add_new_item’ => __(‘Recipe’, ‘FoodRecipe’),
    ‘edit_item’ => __(‘Edit Recipe’, ‘FoodRecipe’),
    ‘new_item’ => __(‘New Recipe’, ‘FoodRecipe’),
    ‘view_item’ => __(‘View Recipe’, ‘FoodRecipe’),
    ‘search_items’ => __(‘Search Recipes’, ‘FoodRecipe’),
    ‘not_found’ => __(‘No Recipes found’, ‘FoodRecipe’),
    ‘not_found_in_trash’ => __(‘No Recipes found in Trash’, ‘FoodRecipe’),
    ‘parent_item_colon’ => ”
    );

    $supports = array(
    ‘title’,
    ‘editor’,
    ‘thumbnail’,
    ‘categories’,
    ‘comments’,
    ‘excerpt’,
    ‘author’
    );

    register_post_type( ‘recipe’,
    array(
    ‘labels’ => $labels,
    ‘public’ => true,
    ‘menu_position’ => 5,
    ‘hierarchical’ => true,
    ‘supports’ => $supports,
    ‘taxonomies’ => array(‘recipe-type’, ‘post_tag’, ‘category’),
    ‘rewrite’ => array( ‘slug’ => __(‘recipe’, ‘FoodRecipe’) )
    )
    );

    Any help would be appreciated. I’ve been struggling to get custom posts to work with any of the wordpress mobile plugins, and this is the one that comes the closest.

    https://wordpress.org/plugins/wptouch/

    [Moderator Note: No bumping. If it’s that urgent, consider hiring someone instead.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    I read on another forum post that I could just re-register the custom post type in the functions of the wptouch plugin, but I tried and it still did not work. Could you tell me the exact file location to register the plugin?

    Yes, you can try doing that. Though please keep in mind that in WPtouch (free), any changes done to the core files will be overwritten in an event of an update. In WPtouch Pro, since it supports child themes, changes/customizations will be able to survive upgrades.

    The location of the functions.php file in WPtouch (free) is /wp-content/wptouch-data/themes/bauhaus/default/functions.php.

    Thread Starter dishditty

    (@dishditty)

    Well, this is odd. I see the directory wpcontent/wptouch-data/themes, but it’s empty. There is a bauhaus/default/functions.php in wpcontent/plugins/wptouch/themes directory.

    Editing and adding the above code there doesn’t do anything. This is so strange. Is there any debugging I can turn on to look at what messages come through when trying to save the theme general settings?

    Thread Starter dishditty

    (@dishditty)

    Ok, so my workaround is I added the above code to one of my other plugins where it’s registering post types. That works, but makes me nervous. Hopefully it won’t cause anything to go haywire. Fingers crossed!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom post type won't stay selected’ is closed to new replies.