Forum Replies Created

Viewing 15 replies - 721 through 735 (of 738 total)
  • Hello @skyzem

    function category_image() {
        global $post;
        if ( in_category('yourcategory') ) {
        set_post_thumbnail($post->ID, 'attachmentid');
        }
        else if ( in_category('yourcategory') ) {
        set_post_thumbnail($post->ID, 'attachmentid');
        }
        wp_reset_postdata();
    }
    add_action('the_post', 'category_image');

    Add this code in theme’s functions.php. Hope this will solve your purpose.

    Hi @salvador21

    To achieve what you will need to add following code to your child theme functions.php

    function custom_override_checkout_fields( $fields ) {
       if( woo_cart_has_virtual_product() == true ) {
            unset($fields['billing']['billing_first_name']);
            unset($fields['billing']['billing_last_name']);
            unset($fields['billing']['billing_company']);
            unset($fields['billing']['billing_address_1']);
            unset($fields['billing']['billing_address_2']);
            unset($fields['billing']['billing_city']);
            unset($fields['billing']['billing_postcode']);
            unset($fields['billing']['billing_country']);
            unset($fields['billing']['billing_state']);
            unset($fields['billing']['billing_phone']);
            unset($fields['order']['order_comments']);
            unset($fields['billing']['billing_address_2']);
            unset($fields['billing']['billing_postcode']);
            unset($fields['billing']['billing_company']);
            unset($fields['billing']['billing_last_name']);
            unset($fields['billing']['billing_email']);
            unset($fields['billing']['billing_city']);
            return $fields;
       }
    }
    
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    
    /**
    * Check if the cart contains virtual product
    *
    * @return bool
    */
    function woo_cart_has_virtual_product() {
     
     global $woocommerce;
     
     // By default, no virtual product
     $has_virtual_products = false;
     
     // Default virtual products number
     $virtual_products = 0;
     
     // Get all products in cart
     $products = $woocommerce->cart->get_cart();
     
     // Loop through cart products
     foreach( $products as $product ) {
          
          // Get product ID and '_virtual' post meta
          $product_id = $product['product_id'];
          $is_virtual = get_post_meta( $product_id, '?_virtual', true );
          
          // Update $has_virtual_product if product is virtual
          if( $is_virtual == 'yes' )
             $virtual_products += 1;
     }
     
     if( count($products) == $virtual_products )
         $has_virtual_products = true;
     
     return $has_virtual_products;
    }
    • This reply was modified 8 years, 1 month ago by wbcomdesigns.
    Forum: Plugins
    In reply to: Warning SensorNotRequired

    @syccylinders,

    It’s look like You are using javascript file for google map that have parameter “?sensor=true”.
    ex:
    <script language="javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true&v=3"></script>
    so try:
    <script language="javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>

    Error Description:
    The sensor parameter is no longer required for the Google Maps JavaScript API. It won’t prevent the Google Maps JavaScript API from working correctly, but we recommend that you remove the sensor parameter from the script element.

    Sorry @antipole, sorry it’s not ours to do list. We have made a response on the wrong thread.

    Hi @antipole It’s Subscribe2 plugin css specific conflict. We will keep in our suggestion list to fix this issue in our coming updates.

    I’m glad that I could help.

    Hi @tdcarp,
    Yes, you need to activate the child theme only, as any modification that will be done, will be done within the child theme.

    No, the Theme URI statement is not the mandatory part, but the Template is necessary.
    Dont get confuse by any code on codex for the child style code. The lines of code:

    /*
    Theme Name: Hashi Child Theme
    Theme URI: YOUR THEME URL
    Description: DESCRIPTION OF YOUR THEME
    Author: THEME AUTHOR
    Author URI: AUTHOR URI (IF ANY)
    License: GNU General Public License v3 or later
    License URI: https://www.gnu.org/licenses/gpl-3.0.html
    Template: hashi
    Version: 1.0.0
    */

    will work perfectly for you.

    The enqueue statements of the parent theme’s style and js is to maintain the look and feel of the site as it is in the parent theme. But, if you wish to have a different style, you need not to add the code for enqueuing the parent style and js, you can simply add your codes in the child css and js.

    Thanks!

    Hello @tdcarp,
    In order to create a child theme, you basically need to add the following line in the style.css of your child theme folder where you have defined the name of your child theme, like

    /*
    Theme Name: Hashi Child Theme
    Theme URI: YOUR THEME URL
    Description: DESCRIPTION OF YOUR THEME
    Author: THEME AUTHOR
    Author URI: AUTHOR URI (IF ANY)
    License: GNU General Public License v3 or later
    License URI: https://www.gnu.org/licenses/gpl-3.0.html
    Template: hashi
    Version: 1.0.0
    */

    You need to take care of the line – Template: hashi
    this will inform wordpress that the theme is a child theme whose parent is “hashi”

    And you have already enqueued the styles of the parent in the child, that is all fine.

    Thanks!

    Hello @howardlie,
    Please add the following lines of code in your functions.php file of the current activated theme.
    Add the URL in the code you wish to redirect to on clicking on the “Pay” button and the redirection will work.

    add_filter( ‘woocommerce_get_checkout_payment_url’, ‘change_pay_url_my_account_page’, 10, 2);
    function change_pay_url_my_account_page( $pay_url, $this ) {
    $pay_url = “YOUR DESTINATION URL”;
    return $pay_url;
    }

    Hope this works as per your need.

    Glad that I could help @gandlgandl.

    Hello @gandlgandl,
    Please replace the last css that I provided with the following one:

    #page .header-image {
    display: none !important;
    }

    Hope this will serve your purpose!

    • This reply was modified 8 years, 1 month ago by wbcomdesigns. Reason: More appropriate response

    Hello @gandlgandl,
    Please add this code in your css file and it will hide the header image.
    .header-image {
    display: none;
    }

    Hope it works!

    Hello @cntryjewell,
    There must be some plugin installed that might be interfering with the login process. You can deactivate all of your plugins by renaming all of them like “PluginNameXX” and then try to open up the login page.
    One possible issue might be that the wp-login.php file got corrupted, so you can replace the file contents by the fresh downloaded wordpress setup. You can find this file in the root folder of the wordpress installation.
    Hope this helps! ?

    Hello @muraliniceguy97
    You can use this code, and it will execute the ad on every 5th activity.

    <?php $count = 1;?>
    <?php while ( bp_activities() ) : bp_the_activity(); ?>
    <?php bp_get_template_part( ‘activity/entry’ ); ?>
    <?php 
    if($count % 5 == 0){
        the_ad(3860);
    }
    $count++;
    ?>
    <?php endwhile; ?>

    Thanks!

    Hello @amalaia11,

    You can try something like this
    “yourcategory” is the category term for which you want to display things

    add_filter('the_content','shortcode_generator');
    function shortcode_generator($content){
        global $post;
        if(has_category('yourcategory',$post)){
            $content.='[yourshortcode]';
           return $content;
        }
        else{
            return $content;
        }
    }

    Add this code in your theme’s functions.php.Hope this will solve your purpose.

Viewing 15 replies - 721 through 735 (of 738 total)