<?
function add_map( $atts, $content = null ) {
    return '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script type="text/javascript" src="'.get_bloginfo('template_url').'/js/jquery.gmap.js"></script>
        <script type="text/javascript">
            $(\'#google-map\').gMap({
                address: \''.$atts["id"].'\',
                maptype: "ROADMAP",
                zoom: 14,
                markers: [
                    {
                        address: "'.$atts["id"].'",
                        html: `'.$content.'`,
                        icon: {
                        image: "'.get_bloginfo('template_url').'/images/icons/map-icon-red.png",
                            iconsize: [31, 50],
                            iconanchor: [31,50]
                        }
                    }
                ],
                doubleclickzoom: true,
                controls: {
        panControl: true,
                    zoomControl: true,
                    mapTypeControl: true,
                    scaleControl: true,
                    streetViewControl: false,
                    overviewMapControl: true
                }

            });

</script>
';
}

function add_clients( $atts, $content = null ) {
    preg_match_all('#src="(.*?)"#i',$content,$matches);
    $string = '<div id="oc-team-list" class="owl-carousel team-carousel">';
    foreach($matches[1] as $match)
   $string .= '<div class="oc-item">
          <img src="'.$match.'" />
            </div>';
    $string .= '</div>';
    return $string;
}

function register_my_menu() {
    register_nav_menu('header-menu',__( 'Header Menu' ));
    register_nav_menu('footer-menu',__( 'Footer Menu' ));

}

add_action( 'init', 'register_my_menu' );
add_shortcode( 'map', 'add_map' );
add_shortcode( 'clients', 'add_clients' );

remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10);
add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10);

function my_theme_wrapper_start() {
    echo '<section id="main">';
}

function my_theme_wrapper_end() {
    echo '</section>';
}
add_action( 'after_setup_theme', 'woocommerce_support' );
function woocommerce_support() {
    add_theme_support( 'woocommerce' );
}

function shop_left_init() {

    register_sidebar( array(
        'name'          => 'Categories',
        'id'            => 'home_left_1',
        'before_widget' => '<div class="widget-category-menu">',
        'after_widget'  => '</div>',
        'before_title'  => '<h3 class="rounded"><i class="icon-settings2"></i> ',
        'after_title'   => '</h3>',
    ) );

}
add_action( 'widgets_init', 'shop_left_init' );
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 36;' ), 36 );

function woo_related_products_limit() {
    global $product;

    $args['posts_per_page'] = 3;
    return $args;
}
add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' );
function jk_related_products_args( $args ) {
    $args['posts_per_page'] = 3; // 4 related products
    $args['columns'] = 1; // arranged in 2 columns
    return $args;
}
add_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 );
function wcs_woo_remove_reviews_tab($tabs) {
    unset($tabs['reviews']);
    return $tabs;
}

add_action( 'woocommerce_after_shop_loop_item_title', 'my_add_short_description', 9 );
function my_add_short_description() {
	  echo '<span class="title-description">' . the_excerpt() . '</span><br />';
}

{"id":1169,"date":"2017-05-06T06:13:35","date_gmt":"2017-05-06T06:13:35","guid":{"rendered":"http:\/\/loads-group.pk\/?page_id=1169"},"modified":"2018-09-29T10:06:36","modified_gmt":"2018-09-29T10:06:36","slug":"about-loads-group","status":"publish","type":"page","link":"http:\/\/loads-group.pk\/urdu\/","title":{"rendered":"About Loads Group"},"content":{"rendered":"<section id=\"content\">\n<div class=\"content-wrap notoppadding\">\n<div class=\"section notopmargin noborder nobottommargin\">\n<div class=\"container clearfix main-text\">\n<div class=\"container clearfix topmargin-lg2\">\n<h2 class=\"center\">Our Products<\/h2>\n<div class=\"col-sm-3\">\n<p><a href=\"http:\/\/www.loads-group.pk\/products\/mufflers\/\"><img decoding=\"async\" src=\"http:\/\/www.loads-group.pk\/wp-content\/uploads\/2015\/09\/Muffler-320x213.jpg\" alt=\"\" \/><\/a><\/p>\n<h5 class=\"category_h5\">Mufflers &amp; Exhaust Systems<\/h5>\n<div class=\"line2\"><\/div>\n<\/div>\n<div class=\"col-sm-3\">\n<p><a href=\"http:\/\/www.loads-group.pk\/products\/radiators\/\"><img decoding=\"async\" src=\"http:\/\/www.loads-group.pk\/wp-content\/uploads\/2015\/09\/Radiator-2-320x213.jpg\" alt=\"\" \/><\/a><\/p>\n<h5 class=\"category_h5\">Radiators<\/h5>\n<div class=\"line2\"><\/div>\n<\/div>\n<div class=\"col-sm-3\">\n<p><a href=\"http:\/\/www.loads-group.pk\/products\/sheet-metal-components\/\"><img decoding=\"async\" src=\"http:\/\/www.loads-group.pk\/wp-content\/uploads\/2015\/09\/Sheet-Metal-320x213.jpg\" alt=\"\" \/><\/a><\/p>\n<h5 class=\"category_h5\">Sheet Metal Components<\/h5>\n<div class=\"line2\"><\/div>\n<\/div>\n<div class=\"col-sm-3\">\n<p><a href=\"http:\/\/www.loads-group.pk\/products\/radiator-cores\/\"><img decoding=\"async\" src=\"http:\/\/www.loads-group.pk\/wp-content\/uploads\/2015\/12\/Radiator-Core-320x213.jpg\" alt=\"\" \/><\/a><\/p>\n<h5 class=\"category_h5\">Radiator-Cores<\/h5>\n<div class=\"line2\"><\/div>\n<\/div>\n<hr \/>\n<p>&nbsp;<\/p>\n<div class=\"row main-page-heading\">\n<div class=\"col-md-4\">\n<h3 id=\"ipo\">Loads IPO<\/h3>\n<p><a class=\"aligncenter size-medium wp-image-823\" href=\"http:\/\/www.loads-group.pk\/wp-content\/Loads Limited Prospectus.pdf\">Loads Limited Prospectus.pdf<\/a><br \/>\n<a class=\"aligncenter size-medium wp-image-823\" href=\"http:\/\/www.loads-group.pk\/wp-content\/LL - Shares Subscription Form - Front.pdf\">LL &#8211; Shares Subscription Form &#8211; Front.pdf<\/a><br \/>\n<a class=\"aligncenter size-medium wp-image-823\" href=\"http:\/\/www.loads-group.pk\/wp-content\/LL - Shares Subscription Form (Back).pdf\">LL &#8211; Shares Subscription Form (Back).pdf<\/a><\/p>\n<\/div>\n<div class=\"col-md-4\">\n<h3>Jamapunji<\/h3>\n<p><a href=\"http:\/\/jamapunji.pk\" rel=\"attachment wp-att-625\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-625 alignleft\" style=\"float: none;\" src=\"\/wp-content\/uploads\/2015\/09\/Jama-Punji-logo.jpg\" alt=\"Jama-Punji-logo\" width=\"240\" height=\"112\" srcset=\"http:\/\/loads-group.pk\/urdu\/wp-content\/uploads\/2015\/09\/Jama-Punji-logo.jpg 240w, http:\/\/loads-group.pk\/urdu\/wp-content\/uploads\/2015\/09\/Jama-Punji-logo-180x84.jpg 180w\" sizes=\"(max-width: 240px) 100vw, 240px\" \/><\/a><\/p>\n<\/div>\n<div class=\"col-md-4\">\n<h3>News and Events<\/h3>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"section bgcolor-grey-light footer-stick\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<div class=\"container\">\n<h2 class=\"center nobottommargin\"><\/h2>\n<h2 class=\"center nobottommargin\"><\/h2>\n<h2 class=\"center nobottommargin\">Our <span style=\"color: #e54a27;\">Clients<\/span><\/h2>\n<p>[clients]<br \/>\n<a href=\"\/wp-content\/uploads\/2015\/10\/suzuki.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-35\" src=\"\/wp-content\/uploads\/2015\/10\/suzuki.png\" alt=\"2\" width=\"200\" height=\"200\" \/><\/a>\u00a0 <a href=\"\/wp-content\/uploads\/2015\/10\/toyota.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-34\" src=\"\/wp-content\/uploads\/2015\/10\/toyota.png\" alt=\"1\" width=\"200\" height=\"200\" \/><\/a><a href=\"\/wp-content\/uploads\/2015\/10\/honda.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-37\" src=\"\/wp-content\/uploads\/2015\/10\/honda.png\" alt=\"4\" width=\"200\" height=\"200\" \/><\/a><a href=\"\/wp-content\/uploads\/2015\/10\/hino.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-36\" src=\"\/wp-content\/uploads\/2015\/10\/hino.png\" alt=\"3\" width=\"200\" height=\"200\" \/><\/a><a href=\"\/wp-content\/uploads\/2015\/10\/millat.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-39\" src=\"\/wp-content\/uploads\/2015\/10\/millat.png\" alt=\"6\" width=\"200\" height=\"200\" \/><\/a><a href=\"\/wp-content\/uploads\/2015\/10\/nissan.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-40\" src=\"\/wp-content\/uploads\/2015\/10\/nissan.png\" alt=\"7\" width=\"200\" height=\"200\" \/><\/a> <a href=\"\/wp-content\/uploads\/2015\/10\/hyundai.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-38\" src=\"\/wp-content\/uploads\/2015\/10\/hyundai.png\" alt=\"5\" width=\"200\" height=\"200\" \/><\/a> \u00a0<a href=\"\/wp-content\/uploads\/2015\/10\/mitsubishi.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41\" src=\"\/wp-content\/uploads\/2015\/10\/mitsubishi.png\" alt=\"8\" width=\"200\" height=\"200\" \/><\/a><a href=\"\/wp-content\/uploads\/2015\/10\/yamaha.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41\" src=\"\/wp-content\/uploads\/2015\/10\/yamaha.png\" alt=\"8\" width=\"200\" height=\"200\" \/><\/a><a href=\"\/wp-content\/uploads\/2015\/12\/ROZGAR.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41\" src=\"\/wp-content\/uploads\/2015\/12\/ROZGAR.jpg\" alt=\"8\" width=\"200\" height=\"200\" \/><\/a><\/p>\n<p>[\/clients]<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Our Products Mufflers &amp; Exhaust Systems Radiators Sheet Metal Components Radiator-Cores &nbsp; Loads IPO Loads Limited Prospectus.pdf LL &#8211; Shares Subscription Form &#8211; Front.pdf LL &#8211; Shares Subscription Form (Back).pdf Jamapunji News and Events Our Clients [clients] \u00a0 \u00a0 [\/clients]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"home-page.php","meta":{"footnotes":""},"_links":{"self":[{"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/pages\/1169"}],"collection":[{"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/comments?post=1169"}],"version-history":[{"count":17,"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/pages\/1169\/revisions"}],"predecessor-version":[{"id":1381,"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/pages\/1169\/revisions\/1381"}],"wp:attachment":[{"href":"http:\/\/loads-group.pk\/urdu\/wp-json\/wp\/v2\/media?parent=1169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}