Skip to main content

Posts

Showing posts from July, 2017

add custom post type

/**  *  * add custom post type  *  */ function my_custom_post_product() {   $labels = array(     'name'               => _x( 'Products', 'post type general name' ),     'singular_name'      => _x( 'Product', 'post type singular name' ),     'add_new'            => _x( 'Add New', 'book' ),     'add_new_item'       => __( 'Add New Product' ),     'edit_item'          => __( 'Edit Product' ),     'new_item'           => __( 'New Product' ),     'all_items'          => __( 'All Products' ),     'vi...

call posts by calling custom post types

<?php     $lastposts = get_posts( array(         'posts_per_page' => 5 ,         'post_type'   => 'projects'     ) );     if ( $lastposts ) {         foreach ( $lastposts as $post ) :             setup_postdata( $post ); ?>                 <div class="portfolio-panel" style="background: url(' <?php the_post_thumbnail_url(); ?>')">                     <div class="panel-clickthroughs">                         <a class="company-logo-link">              ...