Affichage des articles dont le libellé est Newest questions tagged wordpress-plugin - Stack Overflow. Afficher tous les articles
Affichage des articles dont le libellé est Newest questions tagged wordpress-plugin - Stack Overflow. Afficher tous les articles

mercredi 29 juin 2016

Telr payment gate way with wordpress

Is there any module that integrate Telr with wordpress? If yes how can I integrate? or else how can I create a new plugin from scratch to manage the payment



via Chebli Mohamed

All the data will be behind a authentication mechanism. This will I assume be built in wordpress and the same will apply to apppresser

Is there any authentication for appPresser as in Wordpress? Please explain? Thanks in Advance.



via Chebli Mohamed

WordPress shortcode displaying as plain text

we have been using a plugin on a website for over a year but for some reason the shortcode is now outputting as a plain text, so actually showing the shortcode itself. The shortcode should produce a product slider.

the plugin in question is: WPB WooCommerce Product slider

The website is: http://ift.tt/29oezrk

The entire page was created inside the WYWYG editor inclusive of the shortcodes. Im unfortunately in a position where I cant start disabling the plugins to identify if theres a conflict.

I have been looking all over the web, I did check out the shortcodes.php file thats included witihn the plugin and I can see in there:

add_shortcode('wpb-latest-product', 'wpb_wps_shortcode');

if( !function_exists( 'wpb_wps_shortcode' ) ):
    function wpb_wps_shortcode($atts){
        extract(shortcode_atts(array(
            'title' => __( 'Latest Products','wpb-wps' ),
        ), $atts));

        $return_string = '<div class="wpb_slider_area wpb_fix_cart">';
        $return_string .= '<h3 class="wpb_area_title">'.$title.'</h3>';
        $return_string .= '<div id="wpb-wps-latest" class="wpb-wps-wrapper owl-carousel '.wpb_ez_get_option( "wpb_slider_type_gen_lat", "wpb_wps_style", "grid cs-style-3" ).'">';

        $args = array(
            'post_type'         => 'product',
            'posts_per_page'    => wpb_ez_get_option( 'wpb_num_pro', 'wpb_wps_general', 12 )
        );

        $loop = new WP_Query( $args );

        if ( $loop->have_posts() ) {
            while ( $loop->have_posts() ) : $loop->the_post();
                global $post, $product;
                $return_string .= '<div class="item">';
                $return_string .= '<figure>';           
                $return_string .= '<a href="'.get_permalink().'" class="wpb_pro_img_url">';
                if (has_post_thumbnail( $loop->post->ID )){
                    $return_string .= get_the_post_thumbnail($loop->post->ID, 'shop_catalog', array('class' => "wpb_pro_img"));
                }else{
                    $return_string .= '<img id="place_holder_thm" src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" />';
                }
                $return_string .='</a>';
                $return_string .='<figcaption>';
                $return_string .='<h3 class="pro_title">';
                if (strlen($post->post_title) > 20) {
                    $return_string .= substr(the_title($before = '', $after = '', FALSE), 0, wpb_ez_get_option( 'wpb_title_mx_ch', 'wpb_wps_style', 10 )) . '...';
                }else{
                    $return_string .= get_the_title();
                }
                $return_string .='</h3>';
                if( $price_html = $product->get_price_html() ){
                    $return_string .='<div class="pro_price_area">'. $price_html .'</div>';
                }
                $return_string .= '<div class="wpb_wps_cart_button"><a href="'.esc_url( $product->add_to_cart_url() ).'" rel="nofollow" data-product_id="'.esc_attr( $product->id ).'" data-product_sku="'.esc_attr( $product->get_sku() ).'" data-quantity="'.esc_attr( isset( $quantity ) ? $quantity : 1 ).'" class="button '. ($product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '') .' product_type_'.esc_attr( $product->product_type ).'">'.esc_html( $product->add_to_cart_text()).'</a></div>';
                $return_string .='</figcaption>';
                $return_string .= '</figure>';
                $return_string .= '</div>';
            endwhile;
        } else {
            echo __( 'No products found','wpb-wps' );
        }
        wp_reset_postdata();
        $return_string .= '</div>';
        $return_string .= '</div>';
        wp_reset_query();
        return $return_string;   
    }
endif;

The shortcode I am using is [wpb-latest-product title=”Latest Product”]

I am seeing if anyone else has encountered this? Or what the best steps are to diagnose such issues.

Also, I tried adding the shortcode in the 'text' tab rather than the 'visual' tab but had no effect.



via Chebli Mohamed

WordPress tinymce default link's target

I'm trying to edit the WordPress TinyMCE editor so all the links has the target = "_blank". I've tried with jquery to set the 'Open link in new tab' checkbox to be always checked but, no results. Thank you



via Chebli Mohamed

Match XML elements that contain 'X'

I'm using the WP-Property and WP-Property: Importer plugins to manage properties on a WordPress powered website. The importer uses xpath rules to help map fields in an imported XML file to their corresponding field on the site.

e.g. 'Display Address' maps to 'address/full'

I have a set of elements that look like this:

<property>
    <feature1>Feature</feature>
    <feature2>Feature</feature>
    <feature3>Feature</feature>
    <feature4>Feature</feature>
    <feature5>Feature</feature>
    <address>
        <full>abc</full>
        <street>def</street>
        <postcode>ghi</postcode>
    </address>
</property>

I want to group these together into one entry rather than setting up separate fields for each one, so I'm looking for a means to match feature* but everything I've tried so far seems to have missed the mark. Goes without saying that I've never dabbled with xpath before today!



via Chebli Mohamed

How do I show product thumbnails in Woocommerce search results?

The default Woocommerce search input I'm using is:

<div class="postcode-search col-lg-4 col-lg-offset-4">

  <input type='textbox' name="s" class="form-control form-inline" style="display: inline;" id="item-search" value="<?php the_search_query();?>" placeholder="Enter your postcode"/>
  <span class="input-group-btn">
    <button class="item-search-btn"><span class="">find stores</span></button>
  </span>
  <?php
    if ( function_exists( 'woocommerce_product_search' ) ) {
      echo woocommerce_product_search( array( 'limit' => 40 ) );
    }
  ?>

</div>

The problem I'm having is that the results page displays the text and the 'leave a comment' link below: enter image description here

Whereas I want the results to be displayed with the thumbnail as such: enter image description here

Does anyone know how I can achieve this result? All suggestions welcome and thank you in advance!



via Chebli Mohamed

How do I programmatically apply a coupon in Woocommerce for first order made by a customer?

In Woocommerce I'm trying to find a way to apply a 20% discount to the first order made by a new customer. It appears that I can use the functions woocommerce_after_checkout_validation and check_new_customer_coupon to do this but it doesn't work.

Here is my code from function.php:

add_action('woocommerce_after_checkout_validation','check_new_customer_coupon', 0);

function check_new_customer_coupon(){
    global $woocommerce;
    // you might change the name of your coupon
    $new_cust_coupon_code = 'test';

    $has_apply_coupon = false;

    foreach ( WC()->cart->get_coupons() as $code => $coupon ) {
        if($code == $new_cust_coupon_code) {
            $has_apply_coupon = true;
        }
    }

    if($has_apply_coupon) {

        if(is_user_logged_in()) {
            $user_id = get_current_user_id();

            // retrieve all orders
            $customer_orders = get_posts( array(
                    'meta_key'    => '_customer_user',
                    'meta_value'  => $user_id,
                    'post_type'   => 'shop_order',
                    'numberposts'=> -1
            ) );

            if(count($customer_orders) > 0) {
                $has_ordered = false;

                $statuses = array('wc-failed', 'wc-cancelled', 'wc-refunded');

                // loop thru orders, if the order is not falled into failed, cancelled or refund then it consider valid
                foreach($customer_orders as $tmp_order) {

                    $order = wc_get_order($tmp_order->ID);
                    if(!in_array($order->get_status(), $statuses)) {
                        $has_ordered = true;
                    }
                }

                // if this customer already ordered, we remove the coupon
                if($has_ordered == true) {
                    WC()->cart->remove_coupon( $new_cust_coupon_code );
                    wc_add_notice( sprintf( "Coupon code: %s is only applicable for new customer." , $new_cust_coupon_code), 'error' );
                    return false;
                }
            } else {
                // customer has no order, so valid to use this coupon
                return true;
            }

        } else {
            // new user is valid
            return true;
        }
    }

}



via Chebli Mohamed

wordpress settings save and read from database

I have options menu in wordpress.

I have option where you can put number.

$num_opts = 'num_opts';
$hidden_num_opts = 'return_num_opts';
$num_opts_field = 'num_opts';
$num_opts_value = get_option( $num_opts );

so I get options value from db

if(( isset($_POST[ $hidden_num_opts ]) && $_POST[ $hidden_num_opts ] == 'Y' ){
$num_opts_value = $_POST[ $num_opts_field ];
 update_option( $num_opts, $num_opts_value);
}

and if value changes we save it to db.

and here is the form. Values get updated when save is pressed. Page gets reloaded and new value is shown in field.

<form name="options_form" method="post" action="">
<input type="hidden" name="<?php echo $hidden_num_opts; ?>" value="Y">

<p><?php _e("Number of options:", 'x' ); ?> 
<input type="text" name="<?php echo $num_opts_field; ?>" value="<?php echo     $num_opts_value; ?>" size="5">
</p><hr />

<?php

$options = array();
for ($opts = 1; $opts <= $num_opts_value; $opts++){
    array_push($options,$opts); 
}

foreach ($options as $option) {
$opt_val = get_option($option);
echo '<input type="hidden" name="hidden_' . $option . '" value="Y">';
echo '<br>';
printf( __('Option %s', 'x'), $option);
echo '<br>';
echo '<input type="text" name="' .  $option . '" value="'. $opt_val .'" size="10">';
echo '<br>';
if(( isset($_POST[ 'hidden_'.$option ]) && $_POST[ 'hidden_'.$option ] == 'Y' )){
update_option($option, $_POST[$option]);
}
}

unset($option);



?>

<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
</p>

</form>

Based on number inserted in first field I create other field. So if we enter 5 when page reloads we get 5 new input fields. We can enter text in it and when we press save everything is saved in db. So we get field id of option name and value of option value.

But page reloads and values aren't shown. When I reload page again value shows.

So for the 1st input I type x and x is saved in db but in input field nothing is shown. When I reload page x is shown. If I then write b instead of x I got b saved and x shown until I reload page. If I don't reload page and just enter new value page gets reloaded and old value is shown.

Any tips?



via Chebli Mohamed

Wordpress Menu - custom child dropdown on click with full-width inline items

I'm trying to find a solution for changing Wordpress menu as it shown on example image. I have a problem with design, how to make child menu float from dropdown item? And also how to make it dropdown on click only?

Thanks in advanced!

.nav li ul {
    visibility: hidden;
    z-index: 9999;
    position: fixed;
    width: 100vw;
    left: 0;
    padding: 0;
    text-align: right !important;
    border: none;
    background: #7bc5f7;
    box-shadow: none;
}
.nav li.et-reverse-direction-nav li ul {
    right: 0;
    top: auto;
    background: #bae1fc;
}
#top-menu li li a {
    width: 100%;
}

Example



via Chebli Mohamed

Wordpress Image upload using xmlrpc get image name

I use xmlrpc for uploading image to my wordpress site. This images only i going use for another mysql table not in post. i use following code

 $rpcurl='http://ift.tt/298qxca';
 $username='admin';
 $password='pass5';
 $blogid=get_current_blog_id(); //Post ID

 $file=file_get_contents('file:///C:/Users/webway/Desktop/ff/2.jpg');
 $filetype = "image/jpeg";
 $filename = "remote_filename.jpg";

xmlrpc_set_type($file,'base64'); // <-- required!
$params = array($blogid,$username,$password,
array('name'=>$filename,'type'=>$filetype,'bits'=>$file,'overwrite'=>false));

$wpdb->insert('wp_bwbps_images', array('image_name' => $filename,'user_id' => '1','gallery_id' => '4'));            

$request = xmlrpc_encode_request('wp.uploadFile',$params);

$result = go($request,$rpcurl);
print_r($result);

function go($request,$rpcurl){
   $ch = curl_init();
   curl_setopt($ch,CURLOPT_POST,1);
   curl_setopt($ch,CURLOPT_URL,$rpcurl);
   curl_setopt($ch,CURLOPT_POSTFIELDS,$request );
   curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
   $result = curl_exec($ch);
}

After upload i insert image name to another table

$wpdb->insert('wp_bwbps_images', array('image_name' => $filename,'user_id' => '1','gallery_id' => '4'));   

Problem is i also enabled 'overwrite'=>false . so if image name is same upload saveed as image_1.jpg like this

What i need is after image upload i need get saved file name using xmlrpc.php so only i can add that file name in to my custum table..

Any other way?



via Chebli Mohamed

How to use Redux Framework Text Field option for Simple Weather JS

Hello Currently i am using Simple weather JS (http://ift.tt/ZDU7Gn) in my wordpress theme for showing live weather and also for options i am using redux framework. i've create a text field for "Name of your City" and my Option Unique ID is > " cpv-hm-cat-op-8 ". Preview of My Redux framework option is below.

array(
'id'       => 'cpv-hm-cat-op-8',
'type'     => 'text',
'title'    => __( 'Name of your city', 'redux' ),
'desc'    => __( 'Write your city which you want to show in weather', 'redux' ),
'default'  => 'New York',
), 

Now i want to use that option in my simple weather JS file and i want my output, when i input name of my city its show in weather of that city. simple weather js option look like =>

  $.simpleWeather({
    location: 'New Jersey',
    woeid: '',
    unit: 'c',
    success: function(weather) {
      html = '<h2><i class="symbol-weather  icon-'+weather.code+'"></i> '+weather.temp+'&deg;'+weather.units.temp+'</h2>';
      html += '<ul><li>'+weather.city+'</li>';  
      $("#weather").html(html);
    },
    error: function(error) {
      $("#weather").html('<p>'+error+'</p>');
    }
  });

Here "Location" i want to add my redux plugin option. but its not working.

  $.simpleWeather({
    location: '<?php global $cpv; echo $cpv['cpv-hm-cat-op-8'];?>',

Kindly Help me how can i add there my redux framework option.



via Chebli Mohamed

Getting similar posts by title?

I am looking at trying to get all the posts which contain a certain name and the code I have is half working. It pulls through standard posts but not sure how to get it to show all the custom post types as well.

Here is the code in the functions.php

add_filter( 'posts_where', 'wpse18703_posts_where', 10, 2 );
function wpse18703_posts_where( $where, &$wp_query )
{
    global $wpdb;
    if ( $wpse18703_title = $wp_query->get( 'wpse18703_title' ) ) {
        $where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'' . esc_sql( $wpdb->esc_like( $wpse18703_title ) ) . '%\'';
    }
    return $where;
}

Here is the code which then uses that function to find posts of that name.

    <div class="main-content large-8 medium-8 small-12 columns">
        <h2><?php the_title(); ?> News and Features</h2>
        <?php
        $title = $wp_query->post->post_title;
        $query = new WP_Query(
            array(
            'wpse18703_title' => "$title",
            'posts_per_page' => 10,
             'post__not_in'  => array($post->ID),
                'post_type' => array('post', 'it_review')
            )
        );

        if ($query->have_posts()){
            while ( $query->have_posts() ) { $query->the_post(); ?>
                <div class="small-12 large-12 gdb-news-container">
                <div class="small-12 large-4 columns gdb-news-image">
                    <?php the_post_thumbnail(); ?>
                </div>
                <div class="small-12 large-8 columns">
                    <h3><?php the_title(); ?></h3>
                <?php echo content(20); ?>
                </div>
                    <div class="clearfix"></div>
                </div>

My ideal scenario would be to use just the title of the game for example Fallout 4 and it shows all posts containing that in the title.



via Chebli Mohamed

Mod rewrite + Wordpress + Static site

I have a wordpress site that is currently up and functional, but I need to add a full non-wordpress site on top of it so that:

  1. All the current wordpress pages/subpages/etc need to be directed as is.
  2. Home page needs to be directed to home.php (where the add-on site's index file resides).
  3. This home page needs to accept the GET parameters and include the appropriate partial files for content.
  4. Although it would be so much easier having the wordpress site in a subdirectory or even a subdomain instead, I can't change any of the original URL structure due to SEO purposes.

I'm guessing it would help if you can get a look at the site.

The site in question is http://www.pos.com. Notice that when you do http://pos.com (without the www), it goes to the page it's supposed to go to, but when you click on "more info" and click on an icon, it tries to go into the wordpress part and do a search.

You can also see that when you try going to http://ift.tt/292dusl, it redirects properly, but when you try http://ift.tt/292W7Ek, it doesn't.

Both sites are working fine in itself, but once I combine them, that's where all the issues arise. Currently this is what I have so far for the rewrites.

Options -MultiViews
Options +FollowSymlinks
IndexIgnore */*
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^(www.)?domain.com [NC]
RewriteCond %{REQUEST_URI} ^/$
Rewriterule ^(.*)$ home.php [L]

# I'm trying to redirect both domain.com and www.domain.com root to home.php. 
# There are some icons that the use will select that will in turn reload the page and include partial files with content. 

RewriteRule ^site/(.*)$ page.php?&page=$1 [L]
# Site specific static files are routed to page.php with the page variable being used to pull that specific partial file. 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(retail\-pos\-for\-growth)/([^/]+)$ home.php?size=growth&industry=retail&friendly=$1&type=$2 [L]
RewriteRule ^(hospitality\-pos\-for\-growth)/([^/]+)$ home.php?size=growth&industry=hospitality&friendly=$1&type=$2 [L]
RewriteRule ^(retail\-pos\-for\-enterprise)/([^/]+)$ home.php?size=enterprise&industry=retail&friendly=$1&type=$2 [L]
RewriteRule ^(hospitality\-pos\-for\-enterprise)/([^/]+)$ home.php?size=enterprise&industry=hospitality&friendly=$1&type=$2 [L]
# Any requests that match above should redirect to home.php with those get variables. The page will include the respective content files.

# Default Wordpress Rewrites
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Maybe I'm not explaining it too well, so if you have any further questions please let me know.

Thanks in advance.



via Chebli Mohamed

WooCommerce 2.6 Custom Endpoint 404 Not Found Error

It seems with version 2.6 WooCommerce have changed the way endpoints and custom profile tabs are made. More infor here http://ift.tt/1NDtw5i and and http://ift.tt/294lIlh

My code bellow is almost similar to the one in these links but clicking on the new profile tab keeps showing the 404 Not Found error. I tried Permalinks refresh and flush_rewrite_rules() but othing seems to work....

if ( !class_exists('My_WC_User_Company') ) {
    class My_WC_User_Company {

        /**
         * Custom endpoint name.
         *
         * @var string
         */
        public static $endpoint = 'my-company';

        /**
         * Plugin actions.
         */
        public function __construct() {
            // Actions used to insert a new endpoint in the WordPress.
            add_action( 'init', array( $this, 'add_endpoints' ) );
            add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );

            // Change the My Accout page title.
            add_filter( 'the_title', array( $this, 'endpoint_title' ) );

            // Insering your new tab/page into the My Account page.
            add_filter( 'woocommerce_account_menu_items', array( $this, 'new_menu_items' ) );
            add_action( 'woocommerce_account_' . self::$endpoint .  '_endpoint', array( $this, 'endpoint_content' ) );
        }

        /**
         * Register new endpoint to use inside My Account page.
         *
         * @see http://ift.tt/29elPY7
         */
        public function add_endpoints() {
            add_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );
        }

        /**
         * Add new query var.
         *
         * @param array $vars
         * @return array
         */
        public function add_query_vars( $vars ) {
            $vars[] = self::$endpoint;

            return $vars;
        }

        /**
         * Set endpoint title.
         *
         * @param string $title
         * @return string
         */
        public function endpoint_title( $title ) {
            global $wp_query;

            $is_endpoint = isset( $wp_query->query_vars[ self::$endpoint ] );

            if ( $is_endpoint && ! is_admin() && is_main_query() && in_the_loop() && is_account_page() ) {
                // New page title.
                $title = __( 'My Company', 'domain' );

                remove_filter( 'the_title', array( $this, 'endpoint_title' ) );
            }

            return $title;
        }

        /**
         * Insert the new endpoint into the My Account menu.
         *
         * @param array $items
         * @return array
         */
        public function new_menu_items( $items ) {
            // Remove the logout menu item.
            $logout = $items['customer-logout'];
            unset( $items['customer-logout'] );

            // Insert your custom endpoint.
            $items[ self::$endpoint ] = __( 'My Company', 'domain' );

            // Insert back the logout item.
            $items['customer-logout'] = $logout;

            return $items;
        }

        /**
         * Endpoint HTML content.
         */
        public function endpoint_content() {

            ob_start();

            // here is some content ?>

            <?php

            $output = ob_get_clean();
            echo $output;
        }

    }
}


add_action('init', '_action_ssd_wp_user_company_init');

if( !( function_exists('_action_ssd_wp_user_company_init')) ){
    function _action_ssd_wp_user_company_init(){
        if (  get_current_user_id() && get_user_meta( get_current_user_id(), 'user_company', true ) == 'yes' ) {
            new My_WC_User_Company();
        }
    }
}

Does anyone have any ideas what couldbe the issue?



via Chebli Mohamed

Possibility of tracking who opened their Woocommerce Order Completed email

I am looking for a tool to track which users didn't receive or didn't open their Woocommerce order complete email (maybe because they didn't check their Spam filter).

I found the Follow-Ups Woocommerce extension, but this only lets you track additional emails and doesn't show you a list of all people that didn't open their mail.

Is there any other way to track Woocommerce Emails as described?



via Chebli Mohamed

Refresh page at intervals

I am Using the following code to refresh the webpage at particular interval. The page seems to refresh but the Google Analytics code is not getting loaded. I have the Google Analytics code also for reference below. I am still a newbie to coding, Would be really great if you could help figure out why the Analytics code is not loading.

Refresh Code

<script type='text/javascript' src='http://ift.tt/292atIw'></script>
<script type="text/javascript">
function refresh_handler() {
    function refresh() {
       var url = $(location).attr('href');
       window.history.pushState("", "<?php echo $meta_title; ?>", url);
       $("#ajaxanalytics").load("http://ift.tt/292ThPu"); 
    }
    setInterval(refresh, 60*1000); //every 1 minutes
}
$(document).ready(refresh_handler);
</script>

Analytics Code

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','http://ift.tt/1pxBd1V','ga');

  ga('create', 'UA-XXXXXX-X', 'auto');
  ga('send', 'pageview');

</script>



via Chebli Mohamed

wordpress ... toggle the new comment_form

I am trying to insert a link to toggle the comment_form using jQuery onclick, but it does not work ...

In my comments.php , I added the following html around the comment_form() :

      <p>BEFORE FORM</p>
      <a style="cursor:pointer" onclick="jQuery('#add-comment).toggle();">Toggle comment-form</a>
      <div id="add-comment" style:"display:none;">

        <?php $comments_args = array(
        ....
        );
        comment_form($comments_args);
        ?>

      <p>AFTER FORM</p>       
      </div>

and to be sure jQuery is loaded, I added the following code in my functions.php

if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
   wp_deregister_script('jquery');
   wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js", false, null);
   wp_enqueue_script('jquery');
}

the link is correctly displaed but the form is not hidden and the toggle does not activate .. where am I wrong ?

thanks for feedback



via Chebli Mohamed

How to add Woocommerce Reports to another page in my site?

I want to show Woocommerce generated Order Reports on another page of my site. They should be visible to a user when he visits that page, rather than the admin panel.

I'm guessing I'll have to extract the jQuery Code and of the graphs from the admin panel of woocommerce and then use it on some other page.



via Chebli Mohamed

Dynamic content in JavaScipt

If got this full screen background slider (Vegas) on a site thats using Wordpress. Now the slider is called using this script:

<script>
        $("body").vegas({
            delay: 7000,
            timer: false,
            shuffle: true,
            transition: 'fade',
            transitionDuration: 2000,
            slides: [
                { src: "photo01.jpg" },
                { src: "photo02.jpg" },
                { src: "photo03.jpg" },
                { src: "photo04.jpg" }
            ],

            overlay: '01.png'
        });
        </script>

Within Wordpress it is possible to make a loop which "loops" the content that is in that file. What I would like to do is something like this:

....   
    slides: [
                    <?php get_template_part('loop-backgrounds'); ?>
                    { src: "some-file-to-stop-the-backgrounds.jpg" }
                ],
....

The loop-backgrounds would look something like this:

    <?php $loop = new WP_Query( array( 'post_type' => 'backgrounds', 'posts_per_page' => -1, 'orderby'=>'id', 'order' => 'ASC') );
        while ( $loop->have_posts() ) : $loop->the_post(); ?>

        { src: <?php if ( has_post_thumbnail() ) {
                the_post_thumbnail();
            } ;?> },

<?php endwhile; wp_reset_query(); ?>

This some-file-to-stop-the-backgrounds.jpg doesn't have a , at the end so it wouldn't break the code (i think). Is this at all possible?



via Chebli Mohamed

Wordpress same site content in different language on different browsers

site content shows in chinese on chrome and mozilla and on mobile also but shows in english on explorer.

I have tried to force the language in wp-config.php to en-US but still having this abnormalities.

How can I solve this problem.



via Chebli Mohamed