dimanche 31 janvier 2016

Create AJAX tabs in admin options page from custom post type loop

For a WordPress crm/password management plugin I am working on, I have created a custom post type called 'client'. I also have made a separate menu page for storing and showing the passwords of these clients (like an options page, just not used for managing options).

What I would like to do is make a loop of the client post type, and outputting a tab for each client with the password-forms. So when I make a new client post, a tab for that client is being added to the password-page.

The tabs content should load via Ajax, so the page doesn't need to refresh. The layout of the tabs also should be the 'standard wordpress way' of displaying tabs in the admin (but restyled with css).

The problem I am facing is that When I click a tab, the whole admin page loads inside the div where only the content (forms) of the posts should load.

This is my page layout:

<div class="password-manager-panel-content">

        <?php

            // Loop through Clients custom post type and make a tab for each client
            echo '<h2 class="nav-tab-wrapper">';

                $args = array(
                    'post_type' => 'client',
                    'post_status' => 'publish',
                    'hide_empty'=> 1,
                    'posts_per_page' => -1,
                    'orderby' => 'name',
                    'order' => 'ASC'
                );

                $clients = new WP_Query( $args );

                if ( $clients -> have_posts() ) {
                    while ( $clients->have_posts() ) : $clients->the_post(); 
                    echo 
                        '<a class="nav-tab" href="?page=password-manager">';    
                                the_title();
                    echo '</a>';
                    endwhile;
                }

            echo '</h2>';

            echo '<div class="password-manager-tab-content">';

                // The actual content should be loaded inside this div              
                echo '<div class="tab-pane" id="ajax-content">';

                    $the_query = new WP_Query(array(
                        'post_type' => 'client',
                        'posts_per_page' => -1,
                        //'post_name' => $client->slug
                    ));

                    while ( $the_query->have_posts() ) : 
                    $the_query->the_post();

                            echo '<div class="password-manager-tab-header password-manager-row">';
                                the_title();
                            echo '</div>';  
                            echo '<div class="password-manager-row">';

                               // The content will be replaced with ACF Forms
                               the_content();

                            echo '</div>';

                    endwhile;

                echo '</div>';

            echo '</div>';

        ?>

    </div>

My jQuery / Ajax:

$(document).ready(function() {

    $.ajaxSetup({cache:false});
    $("a.nav-tab").click(function() {
        var post_link = $(this).attr("href");
        var post_id = $(this).attr("rel");

        $("#ajax-content").html("content loading");
        $("#ajax-content").load(post_link);

        $("a.nav-tab").removeClass('nav-tab-active');
        $(this).addClass('nav-tab-active');

        return false;       
    });
});

How can I make sure that the right content (tab content) is loaded via Ajax in the right place, and not loading the entire page again in the div?

screenshot of layout and ajax-loading



via Chebli Mohamed

Calling a wordpress plugin in the header with a hook

I have this plugin http://ift.tt/20AixkF that is called in the footer but i need it to be in my header. I've managed to do that easily with some css. But then i've noticed this line:

 add_action('wp_footer', 'wayne_audio_player_markup');

So i tried this:

add_action('get_header', 'wayne_audio_player_markup');

But it doesn't seem to work. I would like to know if there's a way of calling this plugin in the header without css code.



via Chebli Mohamed

How to add properties to Woocomerce account?

I would like to add some properties to my accounts in woocomerce (ie: eyes color) In the codex, i've found solutions to add fields into checkout but I do not need these informations in checkout, I want them editable into the account page. Is there a programatically solution (or a plugin) ?

Thanks



via Chebli Mohamed

How can I check if I'm on the editor page for Visual Composer?

I need to run a little bit of HTML to run a script in Visual Composer. I'm having a bit of trouble getting this to run through Visual Composer (as I need to run it quite a lot of times so I decided to run it straight in the HTML.

However I only want this piece of code to run when the user is editing a page with Visual Composer.

I tried something like this but it didn't work:

// Check to run scripts
$bodyClass = get_body_class();
if(in_array('vc_editor', $bodyClass)) {
    // Run Script
    $content .= '<script>$(document).ready(function() { generalClass.mainSlider(); });</script>';
}

Any ideas? Is there a is_vc_editor() check that I'm missing?



via Chebli Mohamed

How in Visual composer (grid elements) to show text editor?

I have one problem with setting my theme for Wordpress with visual composer.

When I am making pages in Visual composer I have: CLASSIC MODE | BACKED EDITOR | FRONTEND EDITOR

But when I am editing Grid Elements I have just their grid builder. But I need to see shortcodes inside it. To see someting like this, just for grid elements?

How to make it?

And thanks.



via Chebli Mohamed

samedi 30 janvier 2016

want to embed video from uncommon host into wordpress

I want to embed videos from bal4tv into a wordpress site, I have tried many plugins but can't seem to make it work

here is a URL http://ift.tt/23BgsaR



via Chebli Mohamed

maximize number of special characters in registeration in wordpress

WordPress don't accept member registration with special characters in username , i used the simple following plugin to resolve this issue , it is ok but the issue that maximum number of special characters member can use is 8 only , what can i increase it ? thanks alot

<?php

/*

Plugin Name: Wordpress Special Characters in Usernames

Plugin URI: http://www.oneall.com/

Description: Enables usernames containing special characters (russian, cyrillic, arabic) on your Wordpress Blog

Version: 1.2

Author: Claude Schlesser

Author URI: http://www.oneall.com/

License: GPL2

*/

/**

 * Overrides the Wordpress sanitize_user filter to allow special characters

 */

function wscu_sanitize_user ($username, $raw_username, $strict)

{

    //Strip HTML Tags

    $username = wp_strip_all_tags ($raw_username);



    //Remove Accents

    $username = remove_accents ($username);



    //Kill octets

    $username = preg_replace ('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);



    //Kill entities

    $username = preg_replace ('/&.+?;/', '', $username);



    //If strict, reduce to ASCII, Cyrillic and Arabic characters for max portability.

    if ($strict)

    {

        //Read settings

        $settings = get_option ('wscu_settings');



        //Replace

        $username = preg_replace ('|[^a-z\p{Arabic}\p{Cyrillic}0-9 _.\-@]|iu', '', $username);

    }



    //Remove Whitespaces

    $username = trim ($username);



    // Consolidate contiguous Whitespaces

    $username = preg_replace ('|\s+|', ' ', $username);



    //Done

    return $username;

}



add_filter ('sanitize_user', 'wscu_sanitize_user', 10, 3);



via Chebli Mohamed

Extendiing Woocommerce account page

I'm developing a plugin extension for Woocommerce. I need to add a page to the account page.

Ex. /my-account/xxxx/orderID-someRandomToken

Like in /my-account/view-order/orderID

I want to make the extension as a class.

Thank you,

Regards Rasmus



via Chebli Mohamed

Wordpress plugin - how to disable js/css per page

With Wordpress you have good/bad plugins, some being much more economical than others. By economical I mean that they only call the CSS and JavaScript required for the function when the page is loaded where that function is enabled. Others don't discriminate and call the code on all pages. This can have a negative effect on page load speed/performance.

I have some plugins that are heavy in CSS and are laden with reems of jQuery/Javascript files - I only want them to be enabled on particular pages (not home). In hand I have the page ID and alias. Looking in the plugin folder I also see the main php file that includes all the JS / CSS. Within that file I tried something like is_page() but it seems to have no impact as if is_page has not yet been set.

    <?php if ( is_page( '3486' ) ) { exit; } ?>

exit on a line by itself kills the page indicating that the script is being called.

The question, "How and where do you place an if statement that will prevent the plugin CSS/JavaScript from being called on all pages but a particular one (or perhaps an array of pages)?

I could name the plugin but the question is really more generic to any plugin.



via Chebli Mohamed

Wordpress plugin for support

I have wordpress site with installed woocommerce plugin. Woocommerce has personal area for registered users. And I need on page "personal area" chat for support between admin and sign up users. Maybe exists plugins for this? Thanks you!



via Chebli Mohamed

Does sleep help in PHP to save some memory?

So I have custom Wordpress theme in which i need to import some darta from CSV. Data consist of name, field, city, institution. 4060 lines. Everything except names I'm filtering before input to remove duplicates.

So the main problem is that it just stucks when I trying to import 4k of institutions. Institution is the string from 10 to 30 chars.

I already increased php timeout to 10 minutes and allowed memory to 1024mb. But still I get white screen (no errors) from time to time.

So will sleep function help me if I add it in loop?

foreach ($sub_categories as $key => $sub_cat) {
    $page = wp_insert_term($sub_cat, 'gp_hubs', [
        'parent' => $category['term_id'],
        'slug'   => $this->_generateUniqueSlug($sub_cat)
    ]);

    wp_set_object_terms($page['term_id'], self::MENU_ID, 'nav_menu');

    wp_update_nav_menu_item(self::MENU_ID, 0,  array(
        'menu-item-title' => $sub_cat,
        'menu-item-attr-title' => esc_attr( $sub_cat ),
        'menu-item-object-id' => $page['term_id'],
        'menu-item-db-id' => 0,
        'menu-item-object' => 'gp_hubs',
        'menu-item-parent-id' => $parent_menu_id,
        'menu-item-type' => 'taxonomy',
        'menu-item-url' => get_term_link($page['term_id'], 'gp_hubs'),
        'menu-item-status' => 'publish'
    ));

    sleep(3);
}



via Chebli Mohamed

vendredi 29 janvier 2016

Google maps API, Finding nearby locations (lat, lng stored in DB) based on given coordinate(lat,lng)

I am developing on a WordPress plugin which

First: It collects lat, lng, zip, name and address of registering stores and stores in DB.

Then: Depending on current location of website's viewer it should show a list of all the stores within a given bound (say 5 km radius).

Well I got help from here http://ift.tt/1KJNlrU and based on my requirement I am using this query:

$lat = something;
$lng = something;

"SELECT id, address, name, lat, lng ( 3959 * acos(( cos( deg2rad($lat)) ) * (cos( deg2rad( lat ) )) * (cos( deg2rad( lng ) - deg2rad( $lng ) )) + ((sin( deg2rad( $lat ))) * (sin( deg2rad( lat ) ) ) )) AS distance FROM tablename HAVING distance < 100 ORDER BY distance LIMIT 0 , 20";

But it's not returning any result.

Please help



via Chebli Mohamed

Missing a temporary folder in wp app

I have a wordpress application installed . Now if i tried to upload media file it show me the error missing a temporary folder . I also define a path for temp directory . I also edit the php.ini file upload_tmp_dir variable. My php.ini file content is

upload_tmp_dir = "c:\window\temp"

Nothing helped me . any help will be appreciated .Thanks



via Chebli Mohamed

Showing Failed to load theme wordpress

I tried installing Callisto theme (Rocket theme) in WordPress 4.3.1, but got the following error:

Failed to Load Theme:

I have extracted folder and copied it in development server. Should I enable any settings to make it work???



via Chebli Mohamed

Multi select dynamic list using wordpress

i am new to wordpress please help me to create multi select dynamic list using wordpress. please help me if there is any plugin.

Thnaks in advance



via Chebli Mohamed

How do you keep your Wordpress site plugins up to date with Git

How to you keep our Wordpress site plugins up to date?

Do you prefer to use Git, by install the update on your local machine and use Git to push to the main site repository? How about the require database changes that comes with the plugins update?



via Chebli Mohamed

How to remove the price from virtuemart Wordpress

I want to remove/hide the prices on virtumart on the shop page, checkout and the invoice that is being sent



via Chebli Mohamed

jeudi 28 janvier 2016

Wordpress - show downloads counter in the homepage for the posts separately

I am using WordPress 4.4.1 with grid system for displaying all the posts in the homepage, I am using Simple download monitor plugin its working fine the inside the posts.Now I want to show downloads counter for each posts in the homepage.

 $db_count = sdm_get_download_count_for_post($id); echo $db_count;

i tried using this to display but the counter shows 0

Please share your ideas where i did worng. Thanks....



via Chebli Mohamed

Display single event on a page with events planner wordpress plugin

How do I display a single event with the events planner plugin in wordpress

http://ift.tt/1y4J8ui

If I use [events_planner event_id="1932"] it displays all the events instead of displaying a single one

How do I display a single event ?

Has anybody used it ? Please help



via Chebli Mohamed

How to avoid double inclusion of Bootstrap.js?

We've been developing a theme and stumbled on a weird problem. A popup displayed by bootstrap.js appears for a fraction of a second and then disappears. After thorough research I have figured out that the problem is caused by a plugin which also uses bootstrap.js. Two bootstrap.js were loaded, one from our theme and another from the plugin. How to avoid this conflict?



via Chebli Mohamed

How to integrate dropzone.js with a specific input field for images?

I am using a form in wordpress that allows users to post a post with images. To create the form I used Frontend Uploader (http://ift.tt/1g6NvZO ).

It uses a specific input field for images:

<input id="ug_photo" type="file" value="" name="files[]" class="" multiple="multiple">

And I'd like to create a dropzone for images with dropzone.js that replaces this input field but is still able to upload the images in the same way. However I'm not sure what I have to tweak to dropzone to make this possible... I tried several other solutions that allowed me to add the images to my original form, but upon submitting I get an error from front-end uploader.



via Chebli Mohamed

How I can create mobile app of my website?

I want to convert my website to android app and searching for a tool our plugin which does this. Not sure this is possible or not. Also, I want manage my website and mobile app content from my website backend. kindly share with me the tool or code for this.



via Chebli Mohamed

Woocommerce Subscription Strings

My site:

http://ift.tt/1NEbkXx

I have 3 subscription options:

  1. Monthly - Charged at $49.95 per month until customer cancels
  2. 3-Month - Charged $138.85 at signup and then $49.95 per month after those first 3 months have passed.
  3. 6-Month - Charged $274.70 at signup and then $49.95 per month after those first 6 months have passed.

Settings for (1) are straightforward. Simple $49.95 per month for all time.

Setting for (2 & 3) are:

$138.85 Signup Fee with a Free 3-month trial and then $49.95 monthly. For the 6-Month, it's $274.70 Signup Fee with a 6-month free trial and then $49.95 monthly.

It's the only way I could configure those settings for them to work the way I need them to.

Now, the 'woocommerce_subscriptions_product_price_string', 'my_subs_price_string' display info by default that's just downright confusing for my customers. So this need to be modified.

I managed to eliminate the displayed prices and strings on the Home Page with a filter (and I can live with that) but my problem is, that if a customer adds the item to their cart, those prices also don't display on the Cart Page.

Screencap: http://ift.tt/1TqtZ0t

So, even though this seems like a simple problem to solve, I can't get it done and need a bit of help.

The other alternative is to just display the subscription price on the Home Page. That however causes our Monthly option to display $0 since the settings that allow just the subscription price to display, is applied globally through the simple filter I'm using.

Targeting that by product (if possible) might solve it. But again, it's something that I'm having trouble with implementing.

The filter I'm using, I found here and it looks like this right now:

add_filter( 'woocommerce_subscriptions_product_price_string', 'my_subs_price_string', 10, 3 );

function my_subs_price_string( $subscription_string, $product, $include ) {

    /****
    var_dump($product); Various variables are available to us
    ****/

    return ' Renews at ' . wc_price( $product->subscription_price );
}

Obviously wrong as it stands. Help appreciated.



via Chebli Mohamed

With Gravity Forms, how do I make a form entry count as 2 entries based on a boolean?

I'm working on an event registration form with Gravity Forms. The event needs to be limited to X amount of registrants. Gravity Forms gives us this ability under the "Form Settings > Restrictions > Limit Number of Entries" section. As expected, each form filled out counts as 1 entry.

However, this form also has a "Bringing a Guest?" boolean (Yes or No radio buttons). If "Yes" is selected, I would like the form submission to count as 2 entries. How can this be done?



via Chebli Mohamed

How do I redirect a user to the page they initially came from before being prompted to login with Auth0?

I am using the Auth0 plugin on WordPress, and it seems that there is only one field in the settings to set the URL users are redirected to after logging in. However, I want to have them return to the page they were on prior to logging in (i.e., my WordPress site has multiple protected pages from which users are prompted to login with Auth0). How do I make the redirect URL dynamic, or simply set it to the page they were previously on (the protected page)? I've tried some redirect plugins but it seems that Auth0 always overrides them.

Any help would be greatly appreciated!



via Chebli Mohamed

How to rewrite functions wordpress

In woocommerce plugin file class-wc-booking-cart-manager.php there is this code

/**
     * Constructor
     */
    public function __construct() {
        add_filter( 'woocommerce_add_cart_item', array( $this, 'add_cart_item' ), 10, 1 );
        }

/**
     * Adjust the price of the booking product based on booking properties
     *
     * @param mixed $cart_item
     * @return array cart item
     */
    public function add_cart_item( $cart_item ) {
        if ( ! empty( $cart_item['booking'] ) && ! empty( $cart_item['booking']['_cost'] ) ) {
            $cart_item['data']->set_price( $cart_item['booking']['_cost'] );
        }
        return $cart_item;
    }

I want to change add_cart_item function's code into my child theme functions.php file

Anyone knows how to do that ?



via Chebli Mohamed

Override plugin function Woocommerce

I want to override this function from class-wc-booking-cart-manager.php to my child theme functions.php :

/**
 * Adjust the price of the booking product based on booking properties
 *
 * @param mixed $cart_item
 * @return array cart item
 */
public function add_cart_item( $cart_item ) {
    if ( ! empty( $cart_item['booking'] ) && ! empty( $cart_item['booking']['_cost'] ) ) {
        $cart_item['data']->set_price( $cart_item['booking']['_cost'] );
    }
    return $cart_item;
}

When I comment $cart_item['data']->set_price( $cart_item['booking']['_cost'] ); It works.

But I want to do the same thing into my child theme functions.php file. I don't know how to override this one.

Thanks for your help !



via Chebli Mohamed

How to add wordpress post to plain HTML code?

How to add wordpress post dynamically to HTML page.

Please Help,



via Chebli Mohamed

Bootstrap and css don't be recognized in my plugin

I am trying to make my own plugin on Wordpress and bootstrap and css don't work, there isn't connection between them. Here is my code, if you have any ideas about that I will be very thankful.

 unction my_options_style() {
            wp_register_style('my_options_css', plugin_dir_url(__FILE__) . 'css/style.css', false, '1.0.0');
      wp_register_style('bootstrap_options_css', plugin_dir_url(__FILE__) . 'includes/bootstrap-3.3.6-dist/css/bootstrap.min.css', false, '1.0.0');
      wp_register_style('bootstrap_css', plugin_dir_url(__FILE__) . 'includes/bootstrap-3.3.6-dist/css/bootstrap-theme.min.css', false, '1.0.0');
            wp_enqueue_style('my_options_css');
      wp_enqueue_style('bootstrap_options_css');
      wp_enqueue_style('bootstrap_css');
     }
     add_action('admin_enqueue_scripts', 'my_options_style');


     function theme_scripts() {
      wp_enqueue_script( 'my-ads', plugin_dir_url(__FILE__) . 'includes/bootstrap-3.3.6-dist/js/bootstrap.min.js', array(), '1.0.1', true );
     }
     add_action( 'wp_enqueue_scripts', 'theme_scripts' );



via Chebli Mohamed

Wordpress pipes plugin setting page does not show anything

When I moved my website to a new sever, I test a pipes but it couldn't save new post, I went to the pipes page setting and saw this error.

It's not show anything except a save button and a table below.

For accident, I found that I couldn't add new post and page. I fix it, this just a database error about primary key but setting page still don't show anything.

I had update pipes to lastest version.



via Chebli Mohamed

mercredi 27 janvier 2016

How to integrate PayU money payment integration In wordpress and PHP

I am working on a website in which if user is taking a part in any event or using its services, then he will have to pay money online through PayU money.

can anyone explain that, How can I achieve this in either PHP or Wordpress.

In wordpress I already have done the steps which are mentioned in the Documentation of PayU money.

Please help me, I am first time doing the work like this, means I have never worked on payment gateway integration. Please friends Help me.

Thanxx in Advance.



via Chebli Mohamed

Double Slider in WordPress

I'm trying to figure out how to implement a side by side slider in wordpress. There is a big slider on the left and attached on the right of it there is a small slider. I will post an image of the screenshot of the mockup below. I'm wondering if there is a plugin that can handle this?

Image of banner



via Chebli Mohamed

Display ACF Repeater Fields on Child Pages

I'd like to display the results of an ACF repeater field on child pages. An example of the current code:

<?php if( have_rows('recommended-properties') ): ?>
  <?php while ( have_rows('recommended-properties') ) : the_row(); ?>
    <?php the_sub_field('recommended-properties-title'); ?>
    <?php the_sub_field('recommended-properties-description'); ?>
  <?php endwhile; ?>
<?php endif; ?>

Now, I thought I may be able to store the parent page ID in a variable and use that the same way you can get values from another post (see: http://ift.tt/1xngHJm)

I tried the following:

<?php $parentPageId = wp_get_post_parent_id( $post_ID ); ?>
<?php if( have_rows('recommended-properties', echo $parentPageId;) ): ?>
  <?php while ( have_rows('recommended-properties', echo $parentPageId;) ) : the_row(); ?>
    <?php the_sub_field('recommended-properties-title'); ?>
    <?php the_sub_field('recommended-properties-description'); ?>
  <?php endwhile; ?>
<?php endif; ?>

But no luck unfortunately. Any suggestions for where I can go from here?

Many thanks!



via Chebli Mohamed

Wordpress new-user registration e-mail not sent out when registering with Wordpress-Social-Login

As the title suggests, our Wordpress site will correctly trigger the 'Activation', then 'Welcome' e-mail workflow to users that signup via the the non-WSL (Wordpress Social Login) route. Users that signup via WSL do not trigger the 'Welcome' e-mail, which is a problem.

To be honest, my best guess is that perhaps it has to do something with a non-WSL user trigger the chain of events that starts with a user 'activating' their account, which then fires off the subsequent e-mails.

Any help would be much appreciated.



via Chebli Mohamed

How to add a javascript file to my wordpress plugin?

I want integrate a share button to my wordpress plugin, I know there are many plugins that will do it, but I just want a button at the end of a specific page.

I added this to my controller, the one that loads/registers the rest of the javascripts, but this is not working.

Here is my code from the controller

        wp_enqueue_script(
            'wpProQuiz_front_javascript',
            plugins_url('js/wpProQuiz_front' . (WPPROQUIZ_DEV ? '' : '.min') . '.js', WPPROQUIZ_FILE),
            array('jquery-ui-sortable'),
            WPPROQUIZ_VERSION,
            $footer
        );

        wp_register_script(                  //this is the js file I am registering
            'share_button_javascript',
            plugins_url('js/shareButton.js', __FILE__)

        );

        //wp_enqueue_script('share_button_javascript');

        wp_localize_script('wpProQuiz_front_javascript', 'WpProQuizGlobal', array(
            'ajaxurl' => admin_url('admin-ajax.php'),
            'loadData' => __('Loading', 'wp-pro-quiz'),
            'questionNotSolved' => __('You must answer this question.', 'wp-pro-quiz'),
            'questionsNotSolved' => __('You must answer all questions before you can completed the quiz.',
                'wp-pro-quiz'),
            'fieldsNotFilled' => __('All fields have to be filled.', 'wp-pro-quiz')
        ));

And here is the code in the view of the same controller

<script>var shareButton = new ShareButton()</script>
<sharebutton>Share</sharebutton>

Can someone tell me what am I doing wrong here?



via Chebli Mohamed

error in plugin "In Chat"

in plugin "In Chat" for wordpress it is showing all chat features to non logged in users. If a guest clicks on the chat icon, a warning shows “You must be logged in..” After the warning disappears, it opens the chat sidebar and the guest can start messaging people online. I would like to completely disable the plugin for guests.



via Chebli Mohamed

XML feed for Wordpress Social Board plugin modifications

At work, I've been tasked with modifying the Wordpress Social Board plugin by duplicating their RSS feed functionality to display an XML feed specific to our calendaring system.

For example, this is what our XML feed outputs:

<?xml version="1.0"?>
<events>
<event>
<eventid>1449080815796</eventid>
<sponsorid>14</sponsorid>
<inputsponsor>Administration</inputsponsor>
<displayedsponsor>Lesbian, Gay, Bisexual, and Transgender (LGBT) Resource Center, The Division of Student Affairs</displayedsponsor>
<displayedsponsorurl></displayedsponsorurl>
<date>2016-01-25</date>
<timebegin>18:00</timebegin>
<timeend>20:00</timeend>
<repeat_vcaldef></repeat_vcaldef>
<repeat_startdate></repeat_startdate>
<repeat_enddate></repeat_enddate>
<categoryid>119</categoryid>
<category>Diversity</category>
<title>New 2 &apos;Quse Discussion Group</title>
<description>New 2 &apos;Quse is a discussion group for students who are new to SU/ESF and the lesbian, gay, bisexual, transgender, queer, asexual, and ally (LGBTQA) campus communities.</description>
<location>LGBT Resource Center (750 Ostrom)</location>
<price></price>
<contact_name>Abby Fite</contact_name>
<contact_phone>443-3983</contact_phone>
<contact_email>alfite@syr.edu</contact_email>
<url>http://ift.tt/1SjbJFa;
<recordchangedtime>2015-12-02 13:26:55</recordchangedtime>
<recordchangeduser>dsalgbt2</recordchangeduser>
</event>
</events>

There is one place in the code that actually formats their RSS feed:

elseif ( $feed_class == 'rss' ) {
                $rss_output = (@$this->sboption['section_rss']['rss_output']) ? $this->sboption['section_rss']['rss_output'] : array('title' => true, 'thumb' => true, 'text' => true, 'user' => true, 'tags' => false, 'share' => true, 'info' => true);
                $iframe = @$this->sboption['section_rss']['rss_iframe'];
                $fcount = 0;
                if ( $channel = @$feed->channel ) { // rss
                    if (@$channel->item)
                    foreach($channel->item as $item) {
                        $link = @$item->link;
                        if ( $this->make_remove($link) ) {
                        $fcount++;

                        $thumb = $url = '';
                        foreach($item->children('media', true)->thumbnail as $thumbnail) {
                            $thumb = $thumbnail->attributes()->url;
                        }
                        if ( ! $thumb) {
                            foreach($item->children('media', true)->content as $content) {
                                $thumb = $content->children('media', true)->thumbnail->attributes()->url;
                                if (@$content->attributes()->type == 'image/jpeg')
                                    $url = @$content->attributes()->url;
                            }
                        }
                        if ( ! $thumb) {
                            if (@$item->enclosure->attributes()->type == 'image/jpeg')
                                $thumb = @$item->enclosure->attributes()->url;
                        }

                        if (@$item->category && @$rss_output['tags'])
                        foreach($item->category as $category) {
                            $cats[] = (string) $category;
                        }

                        // set Snippet or Full Text
                        $text = $description = '';
                        if (@$this->sboption['section_rss']['rss_text'])
                            $description = $item->description;
                        else
                            $description = (@$item->children("content", true)->encoded) ? $item->children("content", true)->encoded : $item->description;

                        if (@$description) {
                            $description = preg_replace("/<script.*?\/script>/s", "", $description);
                            if (@$attr['words']) {
                                if ( ! $thumb) {
                                    $thumb = sb_getsrc($description);
                                }
                                $text = $this->word_limiter($description, $link);
                            } else {
                                $text = $description;
                            }
                        }
                        if ($iframe) {
                            if ( ! $url)
                                $url = (@$thumb) ? $thumb : '';
                        }

                        $sbi = $this->make_timestr($item->pubDate, $link);
                        $itemdata = array(
                        'thumb' => (@$thumb) ? $thumb : '',
                        'thumburl' => $url,
                        'title' => '<a href="' . $link . '"'.$target.'>' . (@$attr['titles'] ? $this->title_limiter($item->title) : $item->title) . '</a>',
                        'text' => $text,
                        'tags' => @implode(', ', $cats),
                        'url' => $link,
                        'iframe' => $iframe ? 'icbox' : '',
                        'date' => $item->pubDate,
                        'user' => array(
                            'name' => $channel->title,
                            'url' => $channel->link,
                            'image' => @$channel->image->url
                            ),
                        'type' => 'pencil',
                        'icon' => array(@$themeoption['social_icons'][12], @$themeoption['type_icons'][0])
                        );
                        $final[$sbi] = $layoutobj->sb_create_item($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        if ( isset($slideshow) ) {
                            $itemdata['text'] = @$this->format_text($description);
                            if ($url)
                                $itemdata['thumb'] = $url;
                            $finalslide[$sbi] = $slidelayoutobj->sb_create_slideitem($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        }

                        if ( $fcount >= $results ) break;
                        }
                    }
                } elseif ( $entry = @$feed->entry ) { // atom
                    // get feed link
                    foreach($feed->link as $link) {
                        if ($link->attributes()->rel == 'alternate')
                            $user_url = $link->attributes()->href;
                    }
                    foreach($feed->entry as $item) {
                        $link = @$item->link[0]->attributes()->href;
                        if ( $this->make_remove($link) ) {
                        $fcount++;

                        $title = (string) $item->title;
                        $thumb = $url = '';
                        foreach($item->media as $thumbnail) {
                            $thumb = $thumbnail->attributes()->url;
                        }
                        if ( ! $thumb) {
                            foreach($item->link as $linkitem) {
                                if (@$linkitem->attributes()->rel == 'enclosure') {
                                    if (@$linkitem->attributes()->type == 'image/jpeg')
                                        $thumb = @$content->attributes()->url;
                                }
                            }
                        }

                        $cats = '';
                        if (@$item->category && @$rss_output['tags']) {
                            foreach($item->category as $category) {
                                $cats .= $category->attributes()->term.', ';
                            }
                            $cats = rtrim($cats, ", ");
                        }

                        // set Snippet or Full Text
                        $text = $description = '';
                        if (@$this->sboption['section_rss']['rss_text']) {
                            $description = (string) $item->summary;
                        } else {
                            $content = (string) @$item->content;
                            $description = ($content) ? $content : (string) $item->summary;
                        }

                        if (@$description) {
                            if (@$attr['words']) {
                                if ( ! $thumb) {
                                    $thumb = sb_getsrc($description);
                                }
                                $text = $this->word_limiter($description, $link);
                            }
                            else {
                                $text = $description;
                            }
                        }
                        if ($iframe)
                            $url = (@$thumb) ? $thumb : '';

                        $sbi = $this->make_timestr($item->published, $link);
                        $itemdata = array(
                        'thumb' => @$thumb,
                        'thumburl' => $url,
                        'title' => '<a href="' . $link . '"'.$target.'>' . (@$attr['titles'] ? $this->title_limiter($title) : $title) . '</a>',
                        'text' => @$text,
                        'tags' => @$cats,
                        'url' => $link,
                        'iframe' => $iframe ? 'icbox' : '',
                        'date' => $item->published,
                        'user' => array(
                            'name' => $feed->title,
                            'url' => @$user_url,
                            'image' => @$feed->logo
                            ),
                        'type' => 'pencil',
                        'icon' => array(@$themeoption['social_icons'][12], @$themeoption['type_icons'][0])
                        );
                        $final[$sbi] = $layoutobj->sb_create_item($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        if ( isset($slideshow) ) {
                            $itemdata['text'] = @$this->format_text($description);
                            if ($url)
                                $itemdata['thumb'] = $url;
                            $finalslide[$sbi] = $slidelayoutobj->sb_create_slideitem($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        }

                        if ( $fcount >= $results ) break;
                        }
                    }
                }
            }

I've duplicated the code into another feed class and modified, but it is not pulling any values it seems:

    elseif ( $feed_class == 'dsa' ) {
                $rss_output = (@$this->sboption['section_dsa']['dsa_output']) ? $this->sboption['section_dsa']['dsa_output'] : array('title' => true, 'thumb' => true, 'text' => true, 'user' => true, 'tags' => false, 'share' => true, 'info' => true);
                $iframe = @$this->sboption['section_dsa']['dsa_iframe'];
                $fcount = 0;
                if ( $channel = @$feed->events ) { // rss
                    if (@$channel->event)
                    foreach($channel->event as $item) {
                        $link = @$item->displayedsponsorurl;
                        if ( $this->make_remove($link) ) {
                        $fcount++;

                        $thumb = $url = '';
                        foreach($item->children('media', true)->thumbnail as $thumbnail) {
                            $thumb = $thumbnail->attributes()->url;
                        }
                        if ( ! $thumb) {
                            foreach($item->children('media', true)->content as $content) {
                                $thumb = $content->children('media', true)->thumbnail->attributes()->url;
                                if (@$content->attributes()->type == 'image/jpeg')
                                    $url = @$content->attributes()->url;
                            }
                        }
                        if ( ! $thumb) {
                            if (@$item->enclosure->attributes()->type == 'image/jpeg')
                                $thumb = @$item->enclosure->attributes()->url;
                        }

                        if (@$item->category && @$rss_output['tags'])
                        foreach($item->category as $category) {
                            $cats[] = (string) $category;
                        }

                        // set Snippet or Full Text
                        $text = $description = '';
                        if (@$this->sboption['section_dsa']['dsa_text'])
                            $description = $item->description;
                        else
                            $description = (@$item->children("content", true)->encoded) ? $item->children("content", true)->encoded : $item->description;

                        if (@$description) {
                            $description = preg_replace("/<script.*?\/script>/s", "", $description);
                            if (@$attr['words']) {
                                if ( ! $thumb) {
                                    $thumb = sb_getsrc($description);
                                }
                                $text = $this->word_limiter($description, $link);
                            } else {
                                $text = $description;
                            }
                        }
                        if ($iframe) {
                            if ( ! $url)
                                $url = (@$thumb) ? $thumb : '';
                        }

                        $sbi = $this->make_timestr($item->pubDate, $link);
                        $itemdata = array(
                        'thumb' => (@$thumb) ? $thumb : '',
                        'thumburl' => $url,
                        'title' => '<a href="' . $link . '"'.$target.'>' . (@$attr['titles'] ? $this->title_limiter($item->title) : $item->title) . '</a>',
                        'text' => $text,
                        'tags' => @implode(', ', $cats),
                        'url' => $link,
                        'iframe' => $iframe ? 'icbox' : '',
                        'date' => $item->date,
                        'user' => array(
                            'name' => $channel->title,
                            'url' => $channel->link,
                            'image' => @$channel->image->url
                            ),
                        'type' => 'pencil',
                        'icon' => array(@$themeoption['social_icons'][12], @$themeoption['type_icons'][0])
                        );
                        $final[$sbi] = $layoutobj->sb_create_item($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        if ( isset($slideshow) ) {
                            $itemdata['text'] = @$this->format_text($description);
                            if ($url)
                                $itemdata['thumb'] = $url;
                            $finalslide[$sbi] = $slidelayoutobj->sb_create_slideitem($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        }

                        if ( $fcount >= $results ) break;
                        }
                    }
                } elseif ( $entry = @$feed->entry ) { // atom
                    // get feed link
                    foreach($feed->link as $link) {
                        if ($link->attributes()->rel == 'alternate')
                            $user_url = $link->attributes()->href;
                    }
                    foreach($feed->entry as $item) {
                        $link = @$item->link[0]->attributes()->href;
                        if ( $this->make_remove($link) ) {
                        $fcount++;

                        $title = (string) $item->title;
                        $thumb = $url = '';
                        foreach($item->media as $thumbnail) {
                            $thumb = $thumbnail->attributes()->url;
                        }
                        if ( ! $thumb) {
                            foreach($item->link as $linkitem) {
                                if (@$linkitem->attributes()->rel == 'enclosure') {
                                    if (@$linkitem->attributes()->type == 'image/jpeg')
                                        $thumb = @$content->attributes()->url;
                                }
                            }
                        }

                        $cats = '';
                        if (@$item->category && @$rss_output['tags']) {
                            foreach($item->category as $category) {
                                $cats .= $category->attributes()->term.', ';
                            }
                            $cats = rtrim($cats, ", ");
                        }

                        // set Snippet or Full Text
                        $text = $description = '';
                        if (@$this->sboption['section_dsa']['dsa_text']) {
                            $description = (string) $item->summary;
                        } else {
                            $content = (string) @$item->content;
                            $description = ($content) ? $content : (string) $item->summary;
                        }

                        if (@$description) {
                            if (@$attr['words']) {
                                if ( ! $thumb) {
                                    $thumb = sb_getsrc($description);
                                }
                                $text = $this->word_limiter($description, $link);
                            }
                            else {
                                $text = $description;
                            }
                        }
                        if ($iframe)
                            $url = (@$thumb) ? $thumb : '';

                        $sbi = $this->make_timestr($item->published, $link);
                        $itemdata = array(
                        'thumb' => @$thumb,
                        'thumburl' => $url,
                        'title' => '<a href="' . $link . '"'.$target.'>' . (@$attr['titles'] ? $this->title_limiter($title) : $title) . '</a>',
                        'text' => @$text,
                        'tags' => @$cats,
                        'url' => $link,
                        'iframe' => $iframe ? 'icbox' : '',
                        'date' => $item->published,
                        'user' => array(
                            'name' => $feed->title,
                            'url' => @$user_url,
                            'image' => @$feed->logo
                            ),
                        'type' => 'pencil',
                        'icon' => array(@$themeoption['social_icons'][12], @$themeoption['type_icons'][0])
                        );
                        $final[$sbi] = $layoutobj->sb_create_item($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        if ( isset($slideshow) ) {
                            $itemdata['text'] = @$this->format_text($description);
                            if ($url)
                                $itemdata['thumb'] = $url;
                            $finalslide[$sbi] = $slidelayoutobj->sb_create_slideitem($feed_class, $itemdata, $attr, $rss_output, $sbi);
                        }

                        if ( $fcount >= $results ) break;
                        }
                    }
                }
            }

I apologize for this being a highly specific question. I am inexperienced with PHP, especially for Wordpress plugins and have been tasked to get this working ASAP...

Am I just missing something with the operators not pulling in the values? I haven't set all the values yet, I'm just modifying the ones that already exist before moving onto adding anything.

There are no direct errors my logs pulled, so I believe it's just not pulling in the right values, but I'm not sure how to fix that.



via Chebli Mohamed

How To Adding Custom Fields in Gravity Form

[enter image description here] This is a calendar image1

=====================================

I want to add calender of this type in gravity form.its not built-in in gravity wordpress. if a date booked it will show booked. but first question is how to add this custom. i tried much failed. i hope you can help me.

its very urgent..



via Chebli Mohamed

Like / Dislike Buttons anchored to bottom of screen

I am looking for something like they have on the stumble upon page: http://ift.tt/1tZtiKr you can see a like and dislike button anchored to the bottom of the window. I was woundering if anyone knew of a plugin for wordpress that had this functionality.



via Chebli Mohamed

WP Bootstrap navwalker shows desktop dropdown on mobile

I'm having some trouble with the WP Bootstrap navwalker script for Wordpress. When I'm on mobile, it shows a desktop dropdown when you click on a menu item, instead of the normal Bootstrap menu on mobile. See image here.

Here's a link for the page

My menu code:

<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
    <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/assets/img/logo.png" alt="Aluproff"></a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav">
            <?php do_action('wpml_add_language_selector'); ?>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <?php /* Primary navigation */
                wp_nav_menu( array(
                  'menu' => 'primary',
                  'theme_location' => 'primary',
                  'depth' => 2,
                  'container' => false,
                  'menu_class' => 'nav',
                  //Process nav menu using our custom nav walker
                  'walker' => new wp_bootstrap_navwalker())
                );
            ?>
        </ul>
    </div><!--/.nav-collapse -->
</div>
</nav>

How can I fix this?



via Chebli Mohamed

Performance issue with ibmjstart/wp-bluemix-objectstorage

My app is running on WordPress in the bluemix environment. I have an Object Storage service in my bluemix environment where I store all my media files like pictures.

I am using the http://ift.tt/1J9ZkQL plugin to upload media files directly to the my Object storage when saving media files from the dashboard.

Everything seems to work perfectly files gets saved to Object storage, however when I render pages which contains a lot of images I face a huge lag my page takes almost 1 minute to render.

I have noticed that the images are saved in the wp_posts table with the url you would expect for WordPress and another row is saved in the wp_postmeta table for mapping the image to the object storage. During render of a page this row is used to change the url of each image and I believe that this is why my webpage is slowing down.

Is there any other solution or have i missed something out ?



via Chebli Mohamed

WP Ajax not working in else condition

I am working on WordPress plugin. In plugin there is a check box, when a user checked the checkbox a value will be saved in database via ajax and when its unchecked the value will be deleted from database via ajax. So I create a checkbox and write an ajax code.

Here is my code:

HTML Code

<label class="label" for="purchase">
     <?php _e('Purchase', 'product'); ?>
     <input type="checkbox" id="purchase" />
</label>

<input type="hidden" class="cart_info" value='product id'>

Here is my Ajax and PHP Code:

add_action('wp_ajax_values_save', 'save_check_value');
add_action('wp_ajax_nopriv_values_save', 'save_check_value');
add_action('wp_ajax_values_delete', 'delete_check_value');
add_action('wp_ajax_nopriv_email_values_delete', 'delete_check_value');

add_action("wp_head", "edd_gift_email_ajax");
function edd_gift_email_ajax() {
    ?>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            jQuery("#purchase").click(function () {
                if(jQuery(this).is(":checked")) {
                    var cart_info_save = jQuery('.cart_info').val();

                    var data_save = {
                        action: 'values_save',
                        cart_info_save: cart_info_save
                    }

                    jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', data_save, function (save_result) {
                        alert(save_result);
                    });
                } else {
                    var cart_info_delete = jQuery('.cart_info').val();

                    var data_delete = {
                        action: 'values_delete',
                        cart_info_delete: cart_info_delete
                    }

                    jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', data_delete, function (delete_result) {
                        alert(delete_result);
                    });
                }
            });
        });
    </script>
    <?php
}

And here is my save and delete query

function save_check_value() {
    global $wpdb;

    $info_save = stripcslashes($_REQUEST['cart_info_save']);

    $cart_info_un_sr_save = unserialize($info_save);

    foreach ($cart_info_un_sr_save as $user_gift_cart_save) {
        $prod_user_id_save = $user_cart_save['prod_id'];

        echo $prod_user_id_save . " _ Add This";

        //update_post_meta($prod_user_id_save, 'this_product', '1');
    }
}

function delete_check_value() {
    global $wpdb;

    $info_delete = stripcslashes($_REQUEST['cart_info_delete']);

    $cart_info_un_sr_delete = unserialize($info_delete);
    n
    foreach ($cart_info_un_sr_delete as $user_cart_delete) {
        $prod_user_id_delete = $user_cart_delete['prod_id'];

        echo $edd_gift_prod_user_id_delete . " _ Delete This";

        //delete_post_meta($prod_user_id_delete, 'this_product', '1');
    }
}

So when I checked the check box the alert gives me this value 168 _ Add This (this is what I want) but when I unchecked the check box the alert gives me this value 0 (I want this value 168 _ Delete This).

I checked every thing but I got confused that why else condition not give me the right value.

Any suggestions.



via Chebli Mohamed

Jetpack filter hook for publicize post

I would like to know whether is there any filter hook in jetpack plugin which gets called before post get published on twitter through jetpack using publicize feature.

I browsed many times, but I failed to find so. So any help on this is appreciated. I found this feature mentioned in http://ift.tt/1OOuLRw , but I couldn't find that filter hook over here http://ift.tt/1SJnNRM

Any help on this is appreciated



via Chebli Mohamed

mardi 26 janvier 2016

Ask the Expert word press

Is there any word press plugin where any person can ask a question without login and answered by team of experts.

I have tried CM answer but its not of use for my case. i am New to word press, please help.



via Chebli Mohamed

How to load a different header.php depending on Multilanguage plugin's selected language?

I am currently testing my WordPress site on localhost. I have managed to use Multilanguage plugin to change all of pages' content. But since my main content is in the editor and my menu is in header.php I am unable to do the same for my menu. Which raises a question - how to load a different header.php, translated to another language, depending on the selected language? Or is it better to have my menu included in the editor as well, so I can change it the same way I change my main content? Wouldn't that be inefficient since all of my pages use the same header?

Any help would be appreciated.



via Chebli Mohamed

Wordpress PHP - How to update plugin setting value in main file

This is from inside my Wordpress plugin, inside the main file:

function my_plugin_install() {

    $my_site_url = get_site_url();

    $my_options['my_site_url'] = $my_site_url;

    // Save

}

register_activation_hook(__FILE__, 'my_plugin_install');

Currently, the install is successful but the 'my_site_url' option is not saved. I'm assuming because the way I'm using the $my_options array at this point doesn't mean anything. It should save this data to the wp_options table.

I can't seem to get this to save, or even find a way to test this as using "echo" gives Wordpress an error during install. Is there a best method for running a script and updating the database during install?

Thanks in advance.



via Chebli Mohamed

How to make a full-width background option in visual composer

I'm using X-Theme with Visual Composer 4.6.2 and I'm trying to create a divider layer that goes the full width of the screen like in this mock-up (the blue bar in between the content): mockup

However, all that VC will let me do is go as wide as its container. I've used this on other, pre-fab themes before, but I don't know how to do this. I tried using revslider and a regular img, but neither work. Any ideas?

This is the dev site this is currently on.



via Chebli Mohamed

Adding Wordpress "Add Media" Button to form in own Plugin

I am trying to add my own "Add Media" Button in my own plugin form pages, I created a plugin and I have a form in add-new.php file here is the code:

  <div class="wrap">
<h1><?php _e( 'Add Deal', 'webdevs' ); ?></h1>

<form action="" method="post">
                    <!-- I NEED TO CHANGE THIS TO SHOW "ADD MEDIA BUTTON" -->
                     <input id="upload_image" type="text" size="36" name="upload_image" value="" />
        <input id="upload_image_button" type="button" value="Upload Image" />

      <?php wp_nonce_field( 'deal-new' ); ?>
        <?php submit_button( __( 'Add Deal', 'webdevs' ), 'primary', 'submit_deal' ); ?>

  </form>

How to add the html code and handle it in php

please help

Thnaks



via Chebli Mohamed

Getting the Visual Composer Grid post ID on shortcode

I'm building a page in Wordpress, and am using the pods + visual composer plugins.

What I want to do is to show a Pods field on the VC Grid Builder template. Using the code below I can show the field if I set a static Id, but I can't find a way to get the ID dynamically.

I'm newish to php, but so far I know {{ post_data:ID }} displays the ID after rendering, so I guess that's why the code is failing.

add_shortcode( 'vc_post_field', 'vc_post_field_render' );

function vc_post_field_render() {
    $id = '{{ post_data:ID }}'; // I want to get the grid post id at this point
    $var = pods_field( 'pet', $id, 'comment', true ); //should return comment
    return $var; //should return comment returns nothing
}

An alternative may be to pass the post ID through the shortcode slug

[vc_post_field id="22"]

But I cant get it on the frontend either....

Any idea how to get this?

Their source: http://ift.tt/1HY8SPZ

If nothing works I'll have to go JS way.



via Chebli Mohamed

How to split wordpress sites but still cross polinate user support

I have a wordpress site (http://ift.tt/1UoR41V) that has multiple functions:

  1. Buddypress Social plugin
  2. Learning Management System
  3. Gift Shop
  4. Membership/Subscription management
  5. Visual Composer Design
  6. Article management
  7. Photo Management

So what's happening, is when I have all of the plugins, plus associated "specific" supporting plugins, i have a bloated WP site. The load times for the pages are crazy, because I have over 140 css and js files to load.

What I want to know is is there a method to split the site into functional parts, but have the same USER management? This way I have better response time, but I still have all of the parts?

Thanks.



via Chebli Mohamed

Wordpress: load a plugin into another one

hi and thanks for stopping by. i am currently writing a plugin for wordpress. i need a button inside a certain page, that triggers an email-notification. i figured it would be good to use the woocommerce email functionality, since it is a customer email and i'd like to use the woocommerce-email-templates, too.

i have my content and the class is extended by

class WC_Custom_Email extends WC_Email {
    public function __construct() {
        …
    }
    public function mail( $var1, $var2, $var3 ) {
        …
    }
}

but when i trigger my function via ajax

$email = new WC_Custom_Email();
$email->mail( $var1, $var2, $var3 );

the response is: Fatal error: Class 'WC_Custom_Email' not found in …

same is, when i change it to new WC_Email(). so my guess is, that the woocommerce functionality isn't loaded into my admin->edit_page_xy screen. so the big question is: how would i load the woocommerce functionality (or only the email-functionality) into my plugin..??

hope this is somewhat clear and makes any sense. i only know little php and am completely new to oop.



via Chebli Mohamed

WordPress - How to show a user an error message from a function running in 'init'?

My user has a signup form on the signup page. I hooked my form handling function in 'init' so I can process it (check payment, create account, etc.)

My issue is how can I echo an error message or even a successful notice in the page since I can't echo from 'init', it won't show within the website.

Is there anyway we can solve that?



via Chebli Mohamed

How to prevent wordpress site detection from tools like Wappalyzer or similar tools

I want to prevent wordpress site detection from tools like Wappalyzer or similar tools. i tried "Hide my Wp" plugin and others, but nothing is working for me. wappalyzer browser add on still show the wordpress icon. I see the wappalyzer script how they detect the wordpress (http://ift.tt/1SHa4cq)

They use this code to detect:

"WordPress": {
            "cats": [
                1,
                11
            ],
            "env": "^wp_username$",
            "html": [
                "<link rel=[\"']stylesheet[\"'] [^>]+wp-(?:content|includes)",
                "<link[^>]+s\\d+\\.wp\\.com"
            ],
            "icon": "WordPress.png",
            "implies": "PHP",
            "meta": {
                "generatenter code hereor": "WordPress( [\\d.]+)?\\;version:\\1"
            },
            "script": "/wp-includes/",
            "website": "wordpress.org"
        }

Please tell me anyone how do i stop to detection my website. If anyone have any idea or solve this type of issue?? please give me the newest resource link or way to solve this problem.



via Chebli Mohamed

How to hide download links by recaptcha?

How can I hide a download link by recaptcha ?

I mean that if someone visits my blog post, He should solve a captcha to see the div containing download link.

I've searched but I couldn't find anything.

There's a tutorial here :

http://ift.tt/1BSa9jQ

But that's for login & comment forms. How can I do that for a custom div in my theme ?



via Chebli Mohamed

Add an attachment to wordpress welcome email

I need to add an atachment to the email that is sent to newly created users. The email that is being sent right now is the standard WP email with a link for user to select his password.

I wonder how to add a static pdf file to every welcome email that is being sent witouth modifying the core?

Any help or guidance is much appreciated.



via Chebli Mohamed

How to make a Custom Payment Gateway Plugin in Wordpress?

I am trying to make a Custom Gateway Plugin for my Merchant Account in wordpress based on this API Doc but I got stuck and I don't know how to continue. This plugin using CURL for POST Method to Gateway Server

Now, here is what I done so far:

index.php

<?php
/**
 * Plugin Name: Custom WooCommerce Addon
 */

include 'lib.php';
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
function merchantone_init()
{

    function add_merchantone_gateway_class( $methods ) 
    {
        $methods[] = 'WC_MerchantOne_Gateway'; 
        return $methods;
    }
    add_filter( 'woocommerce_payment_gateways', 'add_merchantone_gateway_class' );

    if(class_exists('WC_Payment_Gateway'))
    {
        class WC_MerchantOne_Gateway extends WC_Payment_Gateway 
        {
        public function __construct()
        {

        $this->id               = 'merchantonegateway';
        $this->icon             = plugins_url( 'images/merchantone.png' , __FILE__ )  ;
        $this->has_fields       = true;
        $this->method_title     = 'BCA Sakuku Settings';        
        $this->init_form_fields();
        $this->init_settings();

        $this->title                      = $this->get_option( 'merchantone_title' );
        $this->description                = $this->get_option( 'merchantone_description' );
        $this->merchant_id                = $this->get_option( 'merchant_id' );
        $this->client_id                  = $this->get_option( 'client_id' ); 
        $this->secret_key                  = $this->get_option( 'secret_key' ); 
        $this->redirect_url                = site_url('/thank-you');


        $this->merchantone_liveurl         = 'http://ift.tt/1PzjUhK';


         if (is_admin()) 
         {
            add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );       }

        }



        public function admin_options()
        {
        ?>
        <h3><?php _e( 'Merchant One addon for WooCommerce', 'woocommerce' ); ?></h3>
        <p><?php  _e( 'Merchant One is a payment gateway service provider allowing merchants to accept credit card.', 'woocommerce' ); ?></p>
        <table class="form-table">
          <?php $this->generate_settings_html(); ?>
        </table>
        <?php
        }



        public function init_form_fields()
        {
        $this->form_fields = array
        (
            'enabled' => array(
              'title' => __( 'Enable/Disable', 'woocommerce' ),
              'type' => 'checkbox',
              'label' => __( 'Enable Merchant One', 'woocommerce' ),
              'default' => 'yes'
              ),
            'merchantone_title' => array(
              'title' => __( 'Title', 'woocommerce' ),
              'type' => 'text',
              'description' => __( 'This controls the title which the buyer sees during checkout.', 'woocommerce' ),
              'default' => __( 'BCA Sakuku', 'woocommerce' ),
              'desc_tip'      => true,
              ),
            'merchantone_description' => array(
              'title' => __( 'Description', 'woocommerce' ),
              'type' => 'text',
              'description' => __( 'Description for BCA Sakuku.', 'woocommerce' ),
              'default' => '',
              'desc_tip'      => true,
              'placeholder' => 'description'
              ),
            'merchant_id' => array(
              'title' => __( 'Merchant ID', 'woocommerce' ),
              'type' => 'text',
              'description' => __( 'This is Merchant ID.', 'woocommerce' ),
              'default' => '',
              'desc_tip'      => true,
              'placeholder' => 'Merchant ID'
              ),
            'client_id' => array(
              'title' => __( 'Client ID', 'woocommerce' ),
              'type' => 'text',
              'description' => __( 'This is Client ID.', 'woocommerce' ),
              'default' => '',
              'desc_tip'      => true,
              'placeholder' => 'Client ID'
              ),
            'secret_key' => array(
              'title' => __( 'Secret Key', 'woocommerce' ),
              'type' => 'text',
              'description' => __( 'This is Secret Key.', 'woocommerce' ),
              'default' => '',
              'desc_tip'      => true,
              'placeholder' => 'Secret Key'
              ),
        );
        }


        public function get_icon() {
        $icon = '';
        if(is_array($this->merchantone_cardtypes ))
        {
        foreach ($this->merchantone_cardtypes as $card_type ) {

            if ( $url = $this->get_payment_method_image_url( $card_type ) ) {

                $icon .= '<img src="' . esc_url( $url ) . '" alt="' . esc_attr( strtolower( $card_type ) ) . '" />';
            }
          }
        }
        else
        {
            $icon .= '<img src="' . esc_url( plugins_url( 'images/merchantone.png' , __FILE__ ) ).'" alt="Mercant One Gateway" />';   
        }

         return apply_filters( 'woocommerce_merchantone_icon', $icon, $this->id );
        }

        public function get_payment_method_image_url( $type ) {

        $image_type = strtolower( $type );

            return  WC_HTTPS::force_https_url( plugins_url( 'images/' . $image_type . '.png' , __FILE__ ) ); 
        }



        /*Get Card Types*/
        function get_card_type($number)
        {
            $number=preg_replace('/[^\d]/','',$number);
            if (preg_match('/^3[47][0-9]{13}$/',$number))
            {
                return 'amex';
            }
            elseif (preg_match('/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/',$number))
            {
                return 'dinersclub';
            }
            elseif (preg_match('/^6(?:011|5[0-9][0-9])[0-9]{12}$/',$number))
            {
                return 'discover';
            }
            elseif (preg_match('/^(?:2131|1800|35\d{3})\d{11}$/',$number))
            {
                return 'jcb';
            }
            elseif (preg_match('/^5[1-5][0-9]{14}$/',$number))
            {
                return 'mastercard';
            }
            elseif (preg_match('/^4[0-9]{12}(?:[0-9]{3})?$/',$number))
            {
                return 'visa';
            }
            else
            {
                return 'Invalid Card No';
            }
        }// End of getcard type function


    //Pre-Authentication using Request Format: JSON and Request Method: Host-to-host HTTP Post

        public function merchantone_params($wc_order) {

            $RequestDate      = date("d/m/Y h:m:s");  
            $data = $this->client_id; 
            $secret = $this->secret_key;
            $currency='IDR';
            $signature = encrypt($data, $secret);
            $merchantone_args = array(
            'MerchantID' => $this->merchant_id,     
            'TransactionID' => $wc_order->get_order_number(),   
            'RequestDate' =>  $RequestDate, 
            'Amount' =>number_format($wc_order->order_total,2,".",""),    
            'CurrencyCode' => $currency,   
            'Tax' => '',    
            'Signature' => $signature,   
            'Description' => get_bloginfo('blogname').' Order #'.$wc_order->get_order_number(),       
            'CallbackURL' => $this->redirect_url, 
            'UserSession'  => '',   
            'TransactionNote' => '',  

            );
            return $merchantone_args ; 
        }





        /*Payment Processing Fields*/
        public function process_payment($order_id)
        {

            global $woocommerce;
                $wc_order = new WC_Order($order_id);




            $gatewayurl = $this->merchantone_liveurl;


            $params = $this->merchantone_params($wc_order);


            $post_string = '';
            foreach( $params as $key => $value )
            { 
              $post_string .= urlencode( $key )."=".urlencode($value )."&"; 
            }
            $post_string = rtrim($post_string,"&");

            $curl_header = array('Accept: application/json', 'Content-Type: application/json');
$trans = array('MerchantID', 'TransactionID' , 'RequestDate', 'Amount','CurrencyCode','Tax','Signature', 'Description','CallbackURL','UserSession','TransactionNote');

$ch = curl_init($gatewayurl);    
curl_setopt($ch, CURLOPT_HTTPHEADER, $curl_header);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($trans));
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);



            if (!($data2 = curl_exec($ch))) {
                throw new Exception( __( 'Empty Merchant One Gateway response.','woocommerce') );;
            }
            curl_close($ch);
            unset($ch);

            $data2 = explode("&",$data2);

            for($i=0;$i<count($data2);$i++) 
            {
                $rsponsedata = explode("=",$data2[$i]);
                $response_array[$rsponsedata[0]] = $rsponsedata[1];

            }


        if ( count($response_array) > 1 )
        {
             if( 100 == $response_array['response_code'] )
            {
            $wc_order->add_order_note( __( $response_array['responsetext']. 'on '.date("d-m-Y h:i:s e").' with Transaction ID = '.$response_array['transactionid'].' using '.$response_array['type'].', Authorization Code ='.$response_array['authcode'].',Response Code ='.$response_array['response_code'].', Response ='.$response_array['response'],  'woocommerce' ) );

            $wc_order->payment_complete($response_array['transactionid']);
            WC()->cart->empty_cart();
            return array (
                        'result'   => 'success',
                        'redirect' => $this->get_return_url( $wc_order ),
                       );
            }
            else 
            {
                $wc_order->add_order_note( __( 'Merchant One payment failed.'.$response_array['responsetext'].', Response Code'.$response_array['response_code'].', Response ='.$response_array['response'],  'woocommerce' ) );
                wc_add_notice('Error Processing Merchant One Payments', $notice_type = 'error' );
            }
        }
        else 
        {
            $wc_order->add_order_note( __( 'Merchant One payment failed.'.$response_array['responsetext'].', Response Code'.$response_array['response_code'].', Response ='.$response_array['response'], 'woocommerce' ) );
            wc_add_notice('Error Processing Merchant One Payments', $notice_type = 'error' );
        }

        }// End of process_payment


        }// End of class WC_Authorizenet_merchantone_Gateway
    } // End if WC_Payment_Gateway
}// End of function authorizenet_merchantone_init

add_action( 'plugins_loaded', 'merchantone_init' );

function merchantone_addon_activate() {

    if(!function_exists('curl_exec'))
    {
         wp_die( '<pre>This plugin requires PHP CURL library installled in order to be activated </pre>' );
    }
}
register_activation_hook( __FILE__, 'merchantone_addon_activate' );

/*Plugin Settings Link*/
function merchantone_settings_link( $links ) {
    $settings_link = '<a href="admin.php?page=wc-settings&tab=checkout&section=wc_merchantone_gateway">' . __( 'Settings' ) . '</a>';
    array_push( $links, $settings_link );
    return $links;
}
$plugin = plugin_basename( __FILE__ );
add_filter( "plugin_action_links_$plugin", 'merchantone_settings_link' );

lib.php

<?php

/*
 * Requirement php library: mcrypt
 * - http://ift.tt/15lxKeT
*/

function encrypt($data, $secret) {
    //Generate a key from a hash
    $key = $secret;

    $key .= substr($key, 0, 8);
    $blockSize = mcrypt_get_block_size(MCRYPT_3DES, MCRYPT_MODE_ECB);
    $len = strlen($data);
    $pad = $blockSize - ($len % $blockSize);
    $data .= str_repeat(chr($pad), $pad);

    $encData = mcrypt_encrypt(MCRYPT_3DES, $key, $data, MCRYPT_MODE_ECB);

    return base64_encode($encData);
}

?>

I already tested on my development url and always got error message such as "internal server error" when checkout using "BCA Sakuku" payment option like screenshot below: bca sakuku payment option

I will make new administrator account in wordpress if anyone interested.



via Chebli Mohamed

lundi 25 janvier 2016

How do I change sign-up fee text in WooCommerce Subscriptions?

So far i've tried adding the following code to my functions.php with no luck:

<?php
function my_text_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
        case 'Sign-up Fee' :
            $translated_text = __( 'bin deposit', 'woocommerce-subscriptions' );
            break;
        case 'Apply Coupon':    
            $translated_text = __( 'Enter Coupon', 'woocommerce' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
?>
<?php
function my_signupfee_string( $pricestring ) {

    $newprice = str_replace( 'sign-up fee', 'bin deposit', $pricestring );
return $newprice;

}

add_filter( 'woocommerce_subscriptions_sign_up_fee', 'my_signupfee_string' );
?>

Neither of these functions are working and I am new to changing the internals of a plugin like Subscriptions.



via Chebli Mohamed

Adding PHP Page to Wordpress Template

I want to add specific page to Wordpress template.

for example , I want to add page called "Our Team" , these page contains special php code, and I tried to access to it through www.domain.com/team

but the wordpress redirect the user to 404.php page.

How I can create php page in Wordpress template folder.



via Chebli Mohamed

Make a color stay on CSS element when selected

Trying to find a way to make a CSS element stay the same color that is set on hover when the element is selected. This is for size variations on a WooCommerce site.

My CSS Code is:

.va-picker-item:hover {
background-color: #000;
}

.va-picker-item:focus {
    background-color: #FFF;
}

which works fine.

The HTML is:

    <div class="va-separator clear"></div>
    <label class="va-attribute-label">Size</label>
    <div class="va-pickers">
        <a class="va-picker va-picker-text " data-attribute="pa_size" data-term="small" title="Small" ><span class="va-picker-item va-text S" >S</span></a>
        <a class="va-picker va-picker-text " data-attribute="pa_size" data-term="medium" title="Medium" ><span class="va-picker-item va-text M" >M</span></a>
        <a class="va-picker va-picker-text " data-attribute="pa_size" data-term="large" title="Large" ><span class="va-picker-item va-text L" >L</span></a>
    </div>
    <!-- /.va-pickers -->
    <div class="va-separator clear"></div>
</div><!-- /.ql-visual-variations -->

I've tried variations of :selected etc but to no avail. Any ideas? I understand that jQuery may also be an option, but my Javascript knowledge is practically nonexistent and the plugin developer offers no support on customization.



via Chebli Mohamed

Change upload directory in worpress

Can anyone tell me about how to change upload directory without touching wp-config.php in Wordpress?



via Chebli Mohamed

dimanche 24 janvier 2016

How to Edit the CSS File of the Installed Plugin in Wordpress

I want to edit the CSS File of the Installed Plugin in Wordpress for some customization of the design.

I tried to found the css file of the installed plugin by navigating through Plugins --> Installed Plugin -->Editor. In that I did'nt find the css file of that plugin instead I found only the .php extension files for the installed plugin.

So i "installed Custom CSS Editor Plugin" and i tried to override the some of the CSS property of that plugin in the custom CSS Editor but the changes i made in that custom css is not reflecting on the web page but i tried to edit the css using inspect element on the browser is working correctly.

And then i tried the same CSS property on the Style.css file for the installed Theme, it is also not reflecting on the web page.

could anyone help me to understand how to edit the css properties of the installed plugin?

thanks in advance.



via Chebli Mohamed

Accessing variables globally

I have been creating a WordPress plugin which basically creates step by step tours on how to change any settings in WordPress. I was able to get most of the other things done, but the most complicated logic is how to check if the tour is running and if it is, get the current step and process it ..

I have been considering options like:

  • Setting global variables
  • Using history.pushState();
  • Using wp_options

Please give your expert opinions on how should I get this done ..



via Chebli Mohamed

WP Shortcodes not being added

I was creating a wordpress plugin where the user enters in some information, and is able to generate shortcodes. I was not quite sure where the shortcodes are supposed to go - my current setup is class-based, and I want to be able to create a shortcode when an AJAX request is being made, and is successful. The following two methods are in the same file in the class.

This method gets called via the admin-ajax.php file:

public static function processAjax()
{

    global $wpdb;
    $event_data = $_POST['obj'];

    $event_title = $event_data[0];
    $event_subdomain = $event_data[1];
    $result_events = $wpdb->get_results("SELECT * FROM wp_shortcode_plugin WHERE subdomain = '{$event_subdomain}'", OBJECT);
    if (sizeof($result_events)>0) {
        echo "duplicate";
    } else {
        add_shortcode($event_subdomain, 'getEmbed');
        $results = $wpdb->insert('wp_shortcode_plugin', array("event_name"=>$event_title, "subdomain"=>$event_subdomain));
        echo json_encode($_POST['obj']);
    }

    die();
}

And here is my getEmbed() method that I would like to call.

public static function getEmbed()
{
    return 'test';
}

It seems that the shortcodes are not being created, however. Am I missing something here? Also, is it possible to pass a value to the getEmbed function from the add_shortcode() method?



via Chebli Mohamed

wordpress form for admin

I want to store information about some packages as an admin and want users to search any field from this data.

I can create customized forms for this but is there any plugin with gives Admin ability to add this data (CRUD) and User can search it without logging in?



via Chebli Mohamed

samedi 23 janvier 2016

Is mirroring Stripe (Subscriptions, Invoices, Coupons...) in your own local database efficient?

Is mirroring Stripe with your own local database is a good thing?

Mirroring using both API calls (create a new plan, coupon, subscription, etc.) and webhooks (new invoice or charge generated, payment failed.) so you can store all data (literally have similar tables with columns matching the stripe objects) locally and work with it faster.

If not, what data do you save locally and what do you request?

Thank you.



via Chebli Mohamed

WP custom plugin: Trying to show saved data on frontend

I'm working on my first plugin and i have made a nice settings page which saves and works. But i have splitted it to few files and now i can't detemine if field is checked.. I have also tried declaring a global variable but i can't get it to work :\

This is how my plugin starts-

global $if_autoload;

add_action('init', 'additional_menus_admin');

function additional_menus_admin() {
    require_once(dirname(__FILE__) . '/admin.php');
    require_once(dirname(__FILE__) . '/hooks.php');
}

I try to see if the "autoload" checkbox is checked on my hooks.php-

add_action('wp_head','hook_additional_menu', 20);

function hook_additional_menu() {
    global $if_autoload;

    echo '<test>'.$if_autoload.'</test>';

}

I have also tried using the get_option function but nothing.. All the fields are being save on my admin.php file and i tried pushing the global variable from there too-

function menu_autoload_callback() {
    $if_autoload = get_option( 'autoload-or-shortcode' );
    echo '<input type="checkbox" name="autoload-or-shortcode" value="1"'. checked( 1, get_option( 'autoload-or-shortcode' ), false ) .' /><br />';
}

What am i doing wrong? any help is appriciated! Thanks



via Chebli Mohamed

Licensing - Greensock In wordpress slider

Okay, I'm really obsessed with GSAP. I'm now developing a slider plugin for Wordpress and use GSAP as it's transition engine and port it as a free & "exclusive" plugin with my own built wp theme in themeforest. Note that I'm not submitting this plugin to wordpress.org's free plugin directory nor github. Even I'm not submitting it to codecanyon separately. Just want to include it with my theme. Now I don't have a greensock business license. I only have the package from github. So, am I permitted to do this?



via Chebli Mohamed

How to delete/update a WordPress plugin option

I am building a simple slider plugin and I am working on the options page that allows you to add new slides, use the media uploader and delete slides. However I cannot understand or find any helpful information on how you delete or update plugin options, or atleast where to run the delete_option() function.

When the user clicks the delete slide link I want the .s-image-row div related to that slide to dissapear and the option to be removed from the database when the page is saved.

Please help, thanks.

PHP - Options page (simplified)

function scratch_image_value( $option ) {

    $scratch_images = get_option( 'scratch_images' );

    //if the option is in the database and not an empty value
    if ( isset($scratch_images[$option]) && $scratch_images[$option] != ""  ) {
        echo $scratch_images[$option];
    //if the option does not exists in the database
    } else { 
        echo "http://localhost/my-site/wp-content/uploads/2015/09/03.jpg"; 
    }

}


<?php
$scratch_images = get_option('scratch_images');
$n = ( count($scratch_images) == 0 ) ? 1 : count($scratch_images);
?>

<input class="s-max-id" type="hidden" name="<?php echo $n; ?>" />

<div class="s-slides-wrapper">

    <?php for ($i = 1; $i <= $n; $i++) { ?>

        <div class="s-image-row">
            <img class="custom_media_image" src="<?php scratch_image_value($i); ?>" />
            <input class="custom_media_url" id="" type="text" name="scratch_images[<?php echo $i; ?>]" value="<?php scratch_image_value($i); ?>" >
            <a href="#" class="button scratch_media_upload">Upload</a>
            <a class="s-delete-slide" href="#">Delete slide</a>
        </div>

    <?php } ?>

</div> 

<a class="s-add-slide" href="#">Add slide</a>

<p class="submit">
    <input type="submit" class="button-primary" value="<?php _e('Save Options', 'scratch-slider'); ?>" />
</p>

jQuery (adding new slide)

jQuery( document ).ready(function(){

    counter = jQuery('.s-max-id').attr('name');
    counter = parseInt(counter);
    counter++;

    jQuery('.s-add-slide').click( function(event) {

        event.preventDefault();
        element = jQuery('.s-image-row').last().clone();

        new_counter = counter++;
        element.find('input').attr('name', 'scratch_images[' + new_counter + ']');
        jQuery('.s-slides-wrapper').append(element);

        return false;

    });

});



via Chebli Mohamed

ACF Date Picker field convert to Age and populate field

I have a Date Picker field in the backend which is used for people to select their Date of Birth, what I need is once the field has been filled out, is for another field to dynamically populate itself with the workings out of 'Current date - Selected date'.

The problem I'm having is with creating this field that will populate itself. Is it even possible using ACF? I've been through the docs of ACF and tried out their update_field() function but to no avail.

Thanks



via Chebli Mohamed

Getting average rating from 3 different blocks

I have a problem here. So, i have this product which has three different qualities, for example :

I have a product and that's Apple, and apple has three qualities, they are :

  • Apple( Price, Taste, Size )

Now when the customers visit the website, they can rate differently for all three qualities. Suppose one of the customer rates,

  • Apple.price = 3 Star
  • Apple.Taste = 4 Star
  • Apple.Size = 5 Star

then, on the other side the average of all those three qualities would be 4 star.

Using basic math 3 + 4 + 5 =1 2 and 12 / 3 = 4.

This is where i am stuck, Showing average for only one customer seems easy but what if many customer rates it and how do i get the average ?

I am using rating Widgets in wordpress. http://ift.tt/1njiSoz

Your help would help a lot, Thank you in advance.



via Chebli Mohamed

woo commerce replace dropdown product variable with label where there is an attribute that has only one selection

I'm completely new on wp Woo Commerce. Using wp AllImport I try to get products from the site bellow but for usability I have one big problem - users need to select all options even there is only one option, to buy a variable product. Is there a solution to display variable products in woo commerce as in this website http://ift.tt/1PcYc1d?

and orphan attribute to be shown as label but in same time to be selected?

Please note the dropdown is show only if there is another attribute (variant) with different value.

I've try to filter orphan values from my Array() but the product has not full details as I wish.

Please see my work result: http://ift.tt/1Pu62z5

As you can see you need to select all dropdowns to buy the product. Thanks in advance



via Chebli Mohamed

WP Site not working

Could anyone please come to solve problem braintreegate.com. I have designed using Word Press. It now shows "Fatal Error".

After activating some plugins like "Gust", "Magee Shortcodes", "Wordfence Security"., then it shows some unsolvable error.

Thanks & Regards, Karamvir



via Chebli Mohamed

wordpress plugin to make a social media wall (and to censor some posts)

I'm searching for a wordpress plugin to make a social media wall. example here: http://ift.tt/1REJYbq I've searched online allready and found this one: http://ift.tt/1Pu0Wmt But I also want posts from wordpress to be visable

If it's possible I would also like to censor some of the content that the page would be showing.



via Chebli Mohamed

Manage Custom Table like posts with search in wordpress

I want to create site from new table which contains few articles and code from other sites fetched using automatic cron job. So i want to display all these articles like wordpress posts in new url http://ift.tt/1NrdYzX including search functionality. I have some webservices which fetching data and saved into new table i created. I want to show them. Please help me.



via Chebli Mohamed

vendredi 22 janvier 2016

How to add exam result in wordpress?

[I would like to dynamic this type of page in my WordPress website. Where the students can find out their exam result by providing the required information showed in the picture. I know that this can be done by php/mysql. Unfortunately, I don't know how to add this function in wordpress.][]



via Chebli Mohamed

Count Checkboxes with Gravity Forms

I'm making a form that is for a summer camp registration form where users will be registering. By the end of the form there is an option of paying in full or making a $50 deposit for each camp selected. I'm using hidden products to handle the total amount per week and adding their value into the total. My question comes if I can use formulas to count the number of checkboxes that have been selected and do the calculations.

Example:

Week 1:

  • Soccer camp

Week 2:

  • Computer camp

Total: $100 (Deposit)



via Chebli Mohamed

Wordpress Blog post page shows blank page

I have a page in word press that displays overview of posts. It's a blog page. Now 15 days back i had updated word press , its plugins and themes. Now word press is 4.4.1 version. The page is blank not showing anything. I tried many solutions like Disabled and enabled plugins Tried changing themes. But nothing worked. If we put text in the page it displays but this wont work [blog number_posts="6" so on][/blog]

Please help me to solve this.



via Chebli Mohamed

jeudi 21 janvier 2016

Captcha is not working on wordpress

I have a website in wordpress. My capctha is not showing . this is the link

http://ift.tt/1NoD02K

Previously it was showing . Any idea ?

Thanks



via Chebli Mohamed

When to use add_action vs add_filter?

It seems cleaner to make a plugin and use add_action -- why would you use add_filter?



via Chebli Mohamed

Notification Block on WordPress

I am newbie on wordpress, I met a problem and need your help. I want to create a block to show the notification for guest and I want to place it on multi pages in my website. I did it. But which have that block, I want to change the way to do that, change one time and apply to all pages. How can I do that? Sorry for my bad English.



via Chebli Mohamed

Flags in language switcher - Polylang WP plugin

I have installed Polylang WP plugin for one site.. and need to add flags but its look like there is no option or any tutorial how to do this.. If anybody have some solution for this will be great.. In meantime I maybe have on..



via Chebli Mohamed

Removing action added by a plugin in Wordpress

I am using Popup Maker plugin for Wordpress and I am trying to prevent it to load on a particular page using the functions.php file of a child theme.

I've located in the plugin's directory the file popup-maker.php which contains the following line at the end:

 add_action( 'plugins_loaded', 'popmake_initialize', 0 );

If I remove / comment this line, the popup will not fire, so I guess this is the action I need to remove. I have read the WP codex and numerous posts but still can't get it to work.

Right now I am stuck at this (function I have added in my child theme's functions.php file):

function remove_popmaker() {
    remove_action('plugins_loaded', 'popmake_initialize', 0);
    }

add_action( 'init', 'remove_popmaker', 1 );

PS: I am using shopkeeper theme and Woocommerce.

All help appreciated, thanks.



via Chebli Mohamed