Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi Sayontan,
    I just install plugin and making settings as document but it doesn’t work.
    I click to Photonic => Authentication ==>Google photos ==> Step 1: Authenticate Okie
    but in Step 2: Obtain Token, it show a loading icon and loads forever.
    You can see here” http://prntscr.com/uzbw6h
    I did disable all plugin but Photonic, and do again but it’s still doesn’t work
    Please help me. Thank you/

    Thread Starter dulich5

    (@dulich5)

    Thank you Greg for you reply, but there is still a problem:

    http://prntscr.com/ki4mu3

    For example, 1600 milion is 1,6 bilion in Vietnamese (1600 triệu = 1,6 tỷ), but the website show 16.tỷ, not right.

    I use round($price,2) but not working.

    http://prntscr.com/ki4t9c
    Please help me to check again. Thank you.

    Thread Starter dulich5

    (@dulich5)

    Because no one call “2,700 triệu” but “2,7 tỷ” (1.000 triệu = 1 tỷ)
    [triệu = million, tỷ= billion)

    Thread Starter dulich5

    (@dulich5)

    Thank you very much!

    Thread Starter dulich5

    (@dulich5)

    Dear Sir,

    I changed “advert_example” to “advert-distric” but it’s still not working:

    http://sangnhuonghieuqua.com/advert-distric/quan-10
    Please give me advice. Tks a lots.

    
    <?php
    /**
    Plugin Name: WPAdverts Snippets - Custom Taxonomies
    Version: 1.0
    Author: Greg Winiarski
    Description: Adds custom taxonomy to [adverts_add] and displays values (as links) in Ad details page.
    */
    add_action( "init", "custom_taxonomies_init", 50 );
    add_filter( "adverts_form_load", "custom_taxonomies_form_load" );
    add_filter( "adverts_list_query", "custom_taxonomies_query" );
    add_action( "adverts_tpl_single_details", "custom_taxonomies_tpl_single_details" );
    /**
     * Custom Taxonomy Init 
     * 
     * Registers new custom taxonomy
     * 
     * @since 1.0
     * @return void
     */
    function custom_taxonomies_init() {
        
        $args = array(
            'label' => __( "Quận, huyện" ),
            'hierarchical' => true,
            'query_var' => true,
            'rewrite' => array('slug' => 'advert-distric'),
        );
        
        register_taxonomy( 'ad_distric', 'advert', $args );
    }
    /**
     * Returns options for ad_distric field
     * 
     * This function is being used when generating category field in the (for example 
     * "post ad" form).
     * 
     * @uses adverts_walk_category_dropdown_tree()
     * @since 1.0
     * @return array
     */
    function custom_taxonomies_options() {
        
        $args = array(
            'taxonomy'      => 'ad_distric',
            'hierarchical'  => true,
            'orderby'       => 'name',
            'order'         => 'ASC',
            'hide_empty'    => false,
            'depth'         => 0,
            'selected'      => 0,
            'show_count'    => 0,
        );
        include_once ADVERTS_PATH . '/includes/class-walker-category-options.php';
        
        $walker = new Adverts_Walker_Category_Options;
        $params = array(
            get_terms( 'ad_distric', $args ),
            0,
            $args
        );
        
        return call_user_func_array(array( &$walker, 'walk' ), $params );
    }
    /**
     * Adds "Taxonomy Example" field into [adverts_add] form.
     * 
     * @since 1.0
     * @access public
     * @param array $form   Adverts Form structure
     * @return array        Customized form structure
     */
    function custom_taxonomies_form_load( $form ) {
        global $pagenow;
        
        if( $form['name'] == "advert" && $pagenow != "post.php" ) {
            $form["field"][] = array(
                "name" => "ad_distric",
                "type" => "adverts_field_select",
                "order" => 8,
                "label" => __( "Quận, huyện", "adverts" ),
                "is_required" => true,
                "max_choices" => 1,
                "options" => array(),
                "options_callback" => "custom_taxonomies_options",
                "validator" => array( 
                    array( "name" => "is_required" ),
                )
            );
        }
        
        if( $form['name'] == "search" ) {
            $form['field'][] = array(
                "name" => "ad_distric",
                "type" => "adverts_field_select",
                "order" => 20,
                "label" => "Quận, huyện",
                "empty_option" => 1,
                "empty_option_text" => "Chọn quận, huyện...",
                "max_choices" => 1,
                "options" => array(),
                "options_callback" => "custom_taxonomies_options",
                "meta" => array(
                    "search_group" => "visible",
                    "search_type" => "half" 
                )
            );
        }
        
        return $form;
    }
    /**
     * Displays selected terms on Ad details page.
     * 
     * This functions is executed by adverts_tpl_single_details filter
     * 
     * @since 1.0
     * @access public
     * @param int $post_id Currently displayed post ID
     */
    function custom_taxonomies_tpl_single_details( $post_id ) {
        $terms = get_the_terms( $post_id, 'ad_distric' );
        
        ?>
        
        <?php if(! empty( $terms ) ): ?>
        <div class="adverts-grid-row">
            <div class="adverts-grid-col adverts-col-30">
                <span class="adverts-round-icon adverts-icon-wordpress"></span>
                <span class="adverts-row-title">Quận, huyện</span>
            </div>
            <div class="adverts-grid-col adverts-col-65">
                <?php foreach( $terms as $term ): ?>
                <a href="<?php echo esc_attr( get_term_link( $term ) ) ?>"><?php echo join( " / ", advert_category_path( $term ) ) ?></a><br/>
                <?php endforeach; ?>
            </div>
        </div>
        <?php endif; ?>
    
        
        <?php
    }
    /**
     * Adds tax_query param to WP_Query
     * 
     * The tax_query is added only if it is in $_GET['advert_example']
     * 
     * @param array $args WP_Query args
     * @return array Modified WP_Query args
     */
    function custom_taxonomies_query( $args ) {
        
        if( ! adverts_request( "ad_distric" ) ) {
            return $args;
        }
        
        $args["tax_query"] = array(
            array(
                'taxonomy' => 'ad_distric',
                'field'    => 'term_id',
                'terms'    => adverts_request( "ad_distric" ),
            ),
        );
        
        return $args;
    }
    Thread Starter dulich5

    (@dulich5)

    Dear Greg,

    I tried with your instructions but it didn’t working right. It’s not only in slugs “advert_example” but also “advert_category” error. You can see at http://sangnhuonghieuqua.com/?advert_category=19

    Please help me clearly how to fix this. Thank you so much again.

    Thread Starter dulich5

    (@dulich5)

    Dear Tara,

    thank you for your reply. I use “Sahifa theme”: http://themeforest.net/item/sahifa-responsive-wordpress-newsmagazineblog/2819356

Viewing 7 replies - 1 through 7 (of 7 total)