Posts

Get Template name by template file name shortcode for all files in wordpess

Page Template File Where we want to show template-full-width.php   <?php /**  * Template Name: Full Width Template  * Template Post Type: post, page  *  * @package WordPress  * @subpackage Twenty_Twenty  * @since Twenty Twenty 1.0  */ get_template_part( 'singular' ); Page Template File where from we get code singular.php <?php /**  * The template for displaying single posts and pages.  *  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/  *  * @package WordPress  * @subpackage Twenty_Twenty  * @since Twenty Twenty 1.0  */ get_header(); ?> <main id="site-content" role="main"> <?php if ( have_posts() ) { while ( have_posts() ) { the_post(); get_template_part( 'template-parts/content', get_post_type() ); } } ?> </main><!-- #site-content --> <?php get_template_part( 'template-parts/footer-menus-widgets' ); ?> <?php get_footer...

How to show custom taxonomy (categories and tags) in Custom Post Type.

 <?php function custom_portfolio_type() { // Set UI labels for Custom Post Type     $labels = array(         'name'                => _x( 'Portfolios', 'Post Type General Name', 'modernizer' ),         'singular_name'       => _x( 'Portfolio', 'Post Type Singular Name', 'modernizer' ),         'menu_name'           => __( 'Portfolios', 'modernizer' ),         'parent_item_colon'   => __( 'Parent Movie', 'modernizer' ),         'all_items'           => __( 'All Portfolios', 'modernizer' ),         'view_item'           => __( 'View Portfolio', 'modernizer' ),         'add_new_item'        => __( 'Add New Portfolio', 'modernizer' ), ...

Registering your Custom Post Type using category

 /* * Creating a function to create our CPT */   function custom_post_type() {   // Set UI labels for Custom Post Type     $labels = array(         'name'                => _x( 'Page Top Post', 'Post Type General Name', 'twentytwenty' ),         'singular_name'       => _x( 'Page Post', 'Post Type Singular Name', 'twentytwenty' ),         'menu_name'           => __( 'All Page Top Post', 'twentytwenty' ),         'parent_item_colon'   => __( 'Parent Page Post', 'twentytwenty' ),         'all_items'           => __( 'Page Top Post', 'twentytwenty' ),         'view_item'           => __( 'View Page Post', 'twentytwenty' ),         'add_new_item'  ...

Add Post Custom type

 <?php add_action( 'wp_ajax_nopriv_action_job_apply', 'uouApplyItem' ); add_action( 'wp_ajax_action_job_apply', 'uouApplyItem' ); // Add New Post Type For job function omega_job_posttype() { global $shortname; register_post_type( 'job', array( 'labels' => array( 'name' => __( 'Job', 'omega'), 'singular_name' => __( 'Job', 'omega'), 'add_new' => __( 'Add New Job', 'omega'), 'add_new_item' => __( 'Add New Job', 'omega'), 'edit_item' => __( 'Edit Job', 'omega'), 'new_item' => __( 'Add New Job', 'omega'), 'view_item' => __( 'View Job', 'omega'), 'search_items' => __( 'Search Job',  'omega'), 'not_found' => __( 'No Job found',  'om...

All Product Show in loop Without any Categoery in Woo Commerce

  <ul class="row product-list">                        <?php $args = array( 'post_type' => 'product', 'posts_per_page' => -1 );     query_posts( $args ); while ( have_posts() ) : the_post();     //print_r($product); //Dump product info      $img_url = $image = wp_get_attachment_image_src( get_post_thumbnail_id( $loop->post->ID ), 'single-post-thumbnail' ); $link = $product->get_permalink();     ?>     <li class="col-lg-3 col-md-3 col-sm-3 col-xs-6 thumbnail">          <div class="caption"> <?php echo do_shortcode('<a href="'.$link.'" class="btn add-to-cart" title=" ">ADD TO CART</a>'); ?>  <?php echo do_shortcode('<a href="'.$link.'" class="btn view-details"title="">VIEW DETAILS...

BACK TO TOP SHORTCODE

  major faults wordpress developer uslu forget <!-- Go Top Back --> <script type="text/javascript"> // create the back to top button $('body').prepend('<a href="#" class="back-to-top">Back to Top</a>'); var amountScrolled = 300; $(window).scroll(function() { if ( $(window).scrollTop() > amountScrolled ) { $('a.back-to-top').fadeIn('slow'); } else { $('a.back-to-top').fadeOut('slow'); } }); $('a.back-to-top, a.simple-back-to-top').click(function() { $('html, body').animate({ scrollTop: 0 }, 700); return false; }); </script> a.back-to-top { display: none; width: 60px; height: 60px; text-indent: -9999px; position: fixed; z-index: 999; right: 20px; bottom: 20px; background: #27AE61 url("../images/up-arrow.png") no-repeat center 43%; -webkit-border-radius: 30px; -moz-border-radius: 30px; border-radius: 30px; } a:hover.back-to-t...