Forum Replies Created

Viewing 15 replies - 1 through 15 (of 36 total)
  • Thread Starter Karastel

    (@karastel)

    oh, that sounds sad 🙁

    I have 4 languages, so I have to duplicate the price 4 times.

    thanks for your reply

    Thread Starter Karastel

    (@karastel)

    I received 2 letters from you. Answered both. In the answer received nothing.

    Thread Starter Karastel

    (@karastel)

    Did you receive my letters? I am afraid that your defense can not miss them, or I got into spam))

    Thread Starter Karastel

    (@karastel)

    I can’t see you site, because: “Forbidden – Users from your country are not permitted to browse this site.”
    So write to my email: k a r a s t e l ((at)) gmail.com

    Thread Starter Karastel

    (@karastel)

    You wrote “And attachment_category displays only for current language versions” – are you using the Development Version I uploaded on 22 April?

    Now — Yes. But before the upgrade, with the above-described method, the problem disappeared.
    ——–

    I am not quite sure what you mean by “if I update parameters photographs (for example, change the title), the language categories synchronized (but only for this photo).”, but I have not yet made any changes for term synchronization.

    For example:
    There is a photograph attached to Russian categories “Транспорт / Воздушный“. But this photo is not attached to the corresponding English categories (because I attached a photo to the Russian categories before to create the appropriate English).
    Then I created the English categories “Transport / Air” and linked it with the Russian category “Транспорт / Воздушный”, using WPML plugin.
    Then I opened the photo & clicked “update”. The photo is automatically attached to English categories “Transport / Air.”

    Thread Starter Karastel

    (@karastel)

    My friend helped me with customization.
    I did not want to write in this thread so far, before all do not work the way I wanted.
    But once you have the new version, I’ll write what has been accomplished:

    • we went back to the conclusion of categories through a file taxonomy.php
    • I put you code with class walker in function.php:
    /**
     * Class MNA_Pad_Counts_Walker adds accurate, padded attachment counts to taxonomy terms.
     *
     * Class Walker is defined in /wp-includes/class-wp-walker.php
     * Class Walker_Category is defined in /wp-includes/category-template.php
     */
    class MNA_Pad_Counts_Walker extends Walker_Category {
        /**
         * MLA Terms
         *
         * @var array
         */
        public $mla_terms = array();
    
        /**
         * Constructor - set the MLA Terms.
         *
         * @param string Taxonomy name/slug.
         */
        function __construct( $taxonomy ) {
            $attr = array (
                'taxonomy' => $taxonomy,
                'pad_counts' => 'true',
            );
            $terms = MLAShortcodes::mla_get_terms( $attr );
            unset( $terms['found_rows'] );
    
            foreach ( $terms as $term ) {
                $this->mla_terms[ $term->term_taxonomy_id ] = $term->count;
            }
        }
    
        /**
         * Start the element output.
         *
         * @see Walker::start_el()
         *
         * @param string Passed by reference. Used to append additional content.
         * @param object Taxonomy data object.
         * @param int    Depth of category in reference to parents. Default 0.
         * @param array  An array of arguments. @see wp_list_categories()
         * @param int    ID of the current category.
         */
        function start_el( &$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0 ) {
    
            if ( isset( $this->mla_terms[ $taxonomy_object->term_taxonomy_id ] ) ) {
                $taxonomy_object->count = $this->mla_terms[ $taxonomy_object->term_taxonomy_id ];
            }
    
            parent::start_el( $output, $taxonomy_object, $depth, $args, $id );
        }
    }// Class MNA_Pad_Counts_Walker
    • I put this function in function.php:
      function mla_ul_li_function() {
      echo('<ul>');
      wp_list_categories( array(
       'taxonomy'     		=> 'attachment_category',
       'hierarchical'  		=> 1,
       'hide_empty'    		=> 1,
       'pad_counts'    		=> 1,
       'show_count'    		=> 1,
       'title_li'      		=> '',
       'use_desc_for_title'	=> 1,
       'walker'        => new MNA_Pad_Counts_Walker( 'attachment_category'),
      ) );
      echo('</ul>');
      }
      add_shortcode( 'mla_ul_li', 'mla_ul_li_function' );
    • In taxonomy.php I put this code:
    $is_media_archive = in_array( $wp_query->query_vars['taxonomy'], array( 'attachment_category', 'attachment_tag' ) );
    if ( $is_media_archive ) {
    	if ( isset( $_REQUEST['use_mla_gallery'] ) ) {
    		$use_mla_gallery = true;
    	} else {
    		$use_mla_gallery = false;
    		$args = array_merge( $wp_query->query_vars, array( 'post_type' => 'attachment', 'post_status' => 'inherit' ) );
    		query_posts( $args );
    	}
    }
    • Also in taxonomy.php I put this code:
    echo do_shortcode('[mla_ul_li]');
    
    //categorys
    $mla_link_attributes = sprintf( 'data-imgid="%1$s" data-postid="%2$s"', $data_imgid, $data_postid );
    $mla_caption = "<a class=\"imgBook\" rel=\"bookmark\" title=\"".sprintf (__('Discussion and a permalink to the photo','galeria-fs'))."\" href=\"{+pagelink_url+}\"><div class=\"galleria-link-bookmark\"></div></a>{+excerpt+}";
    
    //pagination
    echo '<div class="page-link"><span class="b" style="float: left;">'. __( 'Pages:', 'mantra' ).'</span>'.do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" posts_per_page="60" mla_output="paginate_links" mla_link_href="%3$s?"]', $wp_query->query_vars['taxonomy'], $wp_query->query_vars['term'], $wp_query->query_vars['page_url'] )).'</div>';
    
    //photos
    echo do_shortcode( sprintf( '[mla_gallery %1$s="%2$s" mla_caption=\'%3$s\' mla_link_attributes=\'%4$s\' link="file" posts_per_page="60"]', $wp_query->query_vars['taxonomy'], $wp_query->query_vars['term'], $mla_caption, $mla_link_attributes) );

    This solution is allowed to create a structured list of categorys. And attachment_category displays only for current language versions.

    You can see how it’s working here.

    Now, if I update parameters photographs (for example, change the title), the language categories synchronized (but only for this photo). I do not know how it happened, I did not change anything else:-)

    Thread Starter Karastel

    (@karastel)

    I did as it is written in the topic:

    insert into the template this code:

    /**
     * Class MNA_Pad_Counts_Walker adds accurate, padded attachment counts to taxonomy terms.
     *
     * Class Walker is defined in /wp-includes/class-wp-walker.php
     * Class Walker_Category is defined in /wp-includes/category-template.php
     */
    class MNA_Pad_Counts_Walker extends Walker_Category {
        /**
         * MLA Terms
         *
         * @var array
         */
        public $mla_terms = array();
    
        /**
         * Constructor - set the MLA Terms.
         *
         * @param string Taxonomy name/slug.
         */
        function __construct( $taxonomy ) {
            $attr = array (
                'taxonomy' => $taxonomy,
                'pad_counts' => 'true',
            );
            $terms = MLAShortcodes::mla_get_terms( $attr );
            unset( $terms['found_rows'] );
    
            foreach ( $terms as $term ) {
                $this->mla_terms[ $term->term_taxonomy_id ] = $term->count;
            }
        }
    
        /**
         * Start the element output.
         *
         * @see Walker::start_el()
         *
         * @param string Passed by reference. Used to append additional content.
         * @param object Taxonomy data object.
         * @param int    Depth of category in reference to parents. Default 0.
         * @param array  An array of arguments. @see wp_list_categories()
         * @param int    ID of the current category.
         */
        function start_el( &$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0 ) {
    
            if ( isset( $this->mla_terms[ $taxonomy_object->term_taxonomy_id ] ) ) {
                $taxonomy_object->count = $this->mla_terms[ $taxonomy_object->term_taxonomy_id ];
            }
    
            parent::start_el( $output, $taxonomy_object, $depth, $args, $id );
        }
    }// Class MNA_Pad_Counts_Walker

    insert in /wp-includes/category-template.php this code:

    foreach ($taxonomies as $taxonomy) {
        unset( $checklist_walker );
        $checklist_walker = new MNA_Pad_Counts_Walker( $taxonomy );
        $args = array(
            'taxonomy'      => $taxonomy,
            'hierarchical'  => 1,
            'hide_empty'    => 0,
            'pad_counts'    => 1,
            'show_count'    => 1,
            'title_li'      => '',
            'walker'        => $checklist_walker,
        );
    
        echo '<li id="c' . $taxonomy . '" class="tax_list">' . get_taxonomy( $taxonomy )->label . '<ul>';
    
        wp_list_categories( $args );
    
        echo '</ul></li>';
    }

    after this code:

    function wp_list_categories( $args = '' ) {
    	$defaults = array(
    		'show_option_all' => '', 'show_option_none' => __('No categories'),
    		'orderby' => 'name', 'order' => 'ASC',
    		'style' => 'list',
    		'show_count' => 0, 'hide_empty' => 1,
    		'use_desc_for_title' => 1, 'child_of' => 0,
    		'feed' => '', 'feed_type' => '',
    		'feed_image' => '', 'exclude' => '',
    		'exclude_tree' => '', 'current_category' => 0,
    		'hierarchical' => true, 'title_li' => __( 'Categories' ),
    		'echo' => 1, 'depth' => 0,
    		'taxonomy' => 'category'
    	);

    But there is no result.
    What did i do wrong?

    Thread Starter Karastel

    (@karastel)

    thank you, I’ll read a topic 🙂

    Thread Starter Karastel

    (@karastel)

    Thank you!

    Thread Starter Karastel

    (@karastel)

    Thread Starter Karastel

    (@karastel)

    I apologize for not being answered. Any problems and did not have time to engage in a personal project. ((

    I have not found a way to make Semantic URL.

    In the end, I left this variant: http://fresh-trip.com/photo-albums/?taxonomy_slug=attachment_category&term_slug=ryby

    [mla_tag_cloud taxonomy=attachment_category number=0 mla_link_href="{+page_url+}?taxonomy_slug={+taxonomy+}&term_slug={+slug+}"]
    
    [mla_gallery tax_query="array(array('taxonomy'=>'{+request:taxonomy_slug+}','field'=>'slug','terms'=>'{+request:term_slug+}'))" mla_nolink_text="No pages to show." posts_per_page=99 mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?term_slug={+request:term_slug+}&taxonomy_slug={+request:taxonomy_slug+}"]
    
    [mla_gallery tax_query="array(array('taxonomy'=>'{+request:taxonomy_slug+}','field'=>'slug','terms'=>'{+request:term_slug+}'))" mla_nolink_text="Click a term to display the gallery." posts_per_page=99 link="file"]
    Thread Starter Karastel

    (@karastel)

    Delete.
    Now “scan and optimize” working!

    THANK YOU VERY MUCH!
    Also thank you for amazing plugin!

    Thread Starter Karastel

    (@karastel)

    Ok. Thank you.

    Thread Starter Karastel

    (@karastel)

    I use this theme https://wordpress.org/themes/mantra/.
    I make some modifications to the theme. Therefore, for test I deleted my modification and downloaded the latest version of the theme. The problem remained.
    Something is wrong in the theme itself

    Thread Starter Karastel

    (@karastel)

    Worked!
    Problem in my theme.
    What should look for in the first place?

Viewing 15 replies - 1 through 15 (of 36 total)