Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter dabito

    (@dabito)

    I’ll try to find what’s wrong and post it here if I can find it.

    Thanks a lot anyway, Kamal.

    Thread Starter dabito

    (@dabito)

    Hmmm come to think of it, I have a saving function hooked too.

    add_action(‘edit_post’, ‘save_details_lugares’);

    function save_details_lugares(){
    global $post;
    //var_dump($post);
    $custom_meta_fields = array( ‘horarios’,’direccion’,’descripcion_usuario’,’garantia_tdt’,’telefonos’,’servicio_a_domicilio’ );
    foreach( $custom_meta_fields as $custom_meta_field ):
    if(isset($_POST[$custom_meta_field]) && $_POST[$custom_meta_field] != “”):
    update_post_meta($post->ID, $custom_meta_field, $_POST[$custom_meta_field]);
    endif;
    endforeach;
    }

    Do you think that this could be interfering?

    Thread Starter dabito

    (@dabito)

    What I did instead was create the custom post type by code in the functions.php and added support for custom-fields like so:

    add_action(‘init’, ‘lugares_register’);

    function lugares_register() {

    $labels = array(
    ‘name’ => _x(‘Lugares’, ‘post type general name’),
    ‘singular_name’ => _x(‘Lugar’, ‘post type singular name’),
    ‘add_new’ => _x(‘Agregar nuevo’, ‘lugar’),
    ‘add_new_item’ => __(‘Agregar lugar’),
    ‘edit_item’ => __(‘Editar lugar’),
    ‘new_item’ => __(‘Nuevo lugar’),
    ‘view_item’ => __(‘Ver lugar’),
    ‘search_items’ => __(‘Buscar lugares’),
    ‘not_found’ => __(‘No hay lugares’),
    ‘not_found_in_trash’ => __(‘No hay lugares en la papelera’),
    ‘parent_item_colon’ => ”
    );

    $args = array(
    ‘labels’ => $labels,
    ‘public’ => true,
    ‘publicly_queryable’ => true,
    ‘show_ui’ => true,
    ‘query_var’ => true,
    ‘rewrite’ => true,
    ‘capability_type’ => ‘post’,
    ‘hierarchical’ => false,
    ‘menu_position’ => null,
    ‘supports’ => array(‘title’,’editor’,’thumbnail’,’comments’,’custom-fields’)
    );

    register_post_type( ‘lugares’ , $args );
    }

    also, I added the following code within the loop of my single-lugares.php template file.

    <?php if(function_exists(‘kk_star_ratings’)) : echo kk_star_ratings( get_the_ID() ); endif; ?>

    I still get the “an error ocurred” message.

    I’ll do some cleaning up to see if something changes.

    Thread Starter dabito

    (@dabito)

    Hello Kamal,

    Thank you very much for your rapid response. See, I did what you posted and indeed, custom fields support was at first disabled for that particular custom post type. I used your code to enable it and sadly, I still got the error.

    Just in case, I deleted the entry and cookies and added a new one, but didn’t do the trick.

    I’ll try a different custom post type plugin and see how that works.

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