Server IP : 14.241.111.210 / Your IP : 18.119.255.208 Web Server : Apache System : Linux localhost.localdomain 3.10.0-1160.66.1.el7.x86_64 #1 SMP Wed May 18 16:02:34 UTC 2022 x86_64 User : www ( 1001) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/vinfast-ninhbinh.vn/wp-content/themes/vinfast/ |
Upload File : |
<?php // Add custom Theme Functions here add_filter('use_block_editor_for_post', '__return_false'); // Adding CSS and JS to theme add_action('wp_enqueue_scripts', function(){ $childthemeUrl = get_stylesheet_directory_uri(); // css files wp_enqueue_style('owl-carousel',$childthemeUrl.'/css/owl.carousel.min.css'); wp_enqueue_style('owl-carousel',$childthemeUrl.'/lib/owl.carousel.min.css'); wp_enqueue_style('owl-carousel-theme',$childthemeUrl.'/lib/owl.theme.default.min.css'); // js files wp_enqueue_script('owl-carousel',$childthemeUrl.'/lib/owl.carousel.min.js', array(), '1.0', true); wp_enqueue_script('script',$childthemeUrl.'/lib/script.js', array(), '1.0', true); }); function showproducts_shortcode(){ $output = ''; $output .= ' <div class="owl-carousel owl-theme slide-product">'; $child_pages = new WP_Query(array( 'post_type' => 'page', 'posts_per_page' => 16, 'post_parent' => 67, 'no_found_rows' => true, 'order' => 'ASC', 'orderby' => 'id', )); while($child_pages->have_posts()) : $child_pages->the_post(); $output .= '<div class="item"> <div class="item-img"> <img src="'.get_the_post_thumbnail_url(get_the_ID(),'large').'" alt="'.get_the_title().'"> </div> <div class="item-title"> <h3>'.get_the_title().'</h3> </div> <div class="item-slogan"> <p>'.get_post_field('slogan').'</p> </div> <div class="item-info"> <div class="dong-xe"> <p>Dòng xe</p> <h5>'.get_post_field('dong_xe').'</h5> </div> <div class="cho-ngoi"> <p>Số chỗ ngồi</p> <h5>'.get_post_field('cho_ngoi').' chỗ</h5> </div> <div class="quang-duong"> <p>Quãng đường lên tới</p> <h5>'.get_post_field('quang_duong').' Km</h5> </div> </div> <div class="item-price"> <p>Từ '.get_post_field('gia_xe').' VNĐ</p> </div> <div class="item-details"> <a href="'.get_the_permalink().'">XEM CHI TIẾT</a> </div>'; $output .= '</div>'; endwhile; wp_reset_postdata(); $output .= '</div>'; echo $output; } add_shortcode('products-shortcode','showproducts_shortcode');