Custom columns doesn’t appear in custom post type

First, you need to declare/register the new columns: add_filter( ‘manage_tour_posts_columns’, ‘cyb_add_new_columns’ ); function cyb_add_new_columns() { $columns[‘price’] = __(‘Price column title’, ‘cyb-textdomain’ ); $columns[‘test’] = __(‘Test column title’, ‘cyb-textdomain’ ); return $columns; } Then, you can print the content of the column for each post: add_action(‘manage_tour_posts_custom_column’, ‘tour_price_col’, 10 ,2); function tour_price_col( $column, $post_id){ switch ( $column … Read more

the_post() is printing titles in page footer

Instead of query_posts(), use WP_Query(): function shortcode_eventi() { $loop = new WP_Query(array( ‘post_type’ => ‘eventi’ )); ?> <?php if ($loop->have_posts()) : ?> <?php while ($loop->have_posts()) : $loop->the_post(); ?> <small><?php the_time(‘F jS, Y’) ?></small> <?php endwhile; ?> <?php else : ?> <h2 class=”center”>Not Found</h2> <p class=”center”><?php _e(“Sorry, but you are looking for something that isn’t here.”); … Read more

Set thumbnail and title for a post type archive (not post itself!)

Do you mean something like this? $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’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘comments’ ) ); This code goes after the function that creates … Read more

writing posts in indian regional language (Punjabi)

If you want to install WordPress and use it in Punjabi, there is an ongoing effort to localize WordPress into Punjabi; see https://make.wordpress.org/polyglots/teams/ The support forums in Punjabi are not yet complete: https://pan.wordpress.org/ I tried using the Google Translator plugin, but that does not convert the page accurately. Google Translator is machine translation, not human; … Read more

Category archive in with conjunction with custom post type is empty

WordPress only includes the post post type for Category archives by default, but you can add additional post types by altering the query: function wpse241719_add_custom_types_to_category_archives( $query ) { if ( ! is_admin() && is_category() && $query->is_main_query() ) { $query->set( ‘post_type’, array( ‘post’, ‘work’, // ‘another_post_type’, ) ); } } add_filter( ‘pre_get_posts’, ‘wpse241719_add_custom_types_to_category_archives’ );