Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter fcornia

    (@fcornia)

    Thank you so much for your detailed answer, i have not noticed it until now.

    I found that the issue was only related to the Custom Posts published BEFORE the plugin installation. Posts published after the installation correctly display the forementioned fields both in frontend and backend.

    Thank you again for your time.

    Same thing just happened to me, but locally… i’m coding on a Linux VM and i used testing websites via lan on various device. I had some trouble with software updates and i managed a reinstall of php5 apache2.

    I’m not really sure what is going on, but now all files served from WP have 127.0.0.1 path, even if viewed from other than server machine. I’m pretty sure it’s a server (apache?) configuration issue and not a wordpress one, but i’m not strong on networking, so if someone has an idea of how to solve… i appreciate!

    I tested server IP via $SERVER['SERVER_ADDR'] global variable and IP is correct: 127.0.0.1 from inside and 192.168… from outside.

    Thread Starter fcornia

    (@fcornia)

    Thanks for the response.

    The markup is generated in this fashion:

    foreach ( $attachments as $id => $attachment ) {
        // markup for each image
        // image insertion
        ... current(wp_get_attachment_image_src( $id, 'large', false)) ...
    }

    However, the matter was ordering the array, the output was fine. In the end i resolved merging the code i have posted with the current media.php in my 4.3.2

    Now the code look in this fashion

    static $instance = 0;
        $instance++;
    
        // straight from media.php
        if ( ! empty( $attrs['ids'] ) ) {
        // 'ids' is explicitly ordered, unless you specify otherwise.
    	if ( empty( $attrs['orderby'] ) ) {
                $attrs['orderby'] = 'post__in';
    	}
    	$attrs['include'] = $attrs['ids'];
        }
    
        // Limiting what the user can do hardcoding most short code options.
        $id = intval($id);
    
        if ( !empty($attrs['include']) ) {
            $params = array(
                        'include' => $attrs['include'],
                        'post_status' => 'inherit',
                        'post_type' => 'attachment',
                        'post_mime_type' => 'image',
                        'order' => 'ASC',
                        'orderby' => $attrs['orderby']);
            $_attachments = get_posts( $params );
            $attachments = array();
            foreach ( $_attachments as $key => $val ) {
                $attachments[$val->ID] = $_attachments[$key];
            }
        } else {
            $params = array(
                        'post_parent' => $id,
                        'post_status' => 'inherit',
                        'post_type' => 'attachment',
                        'post_mime_type' => 'image',
                        'order' => 'ASC',
                        'orderby' => 'menu_order ID');
                $attachments = get_children( $params );
        }
    
        if ( empty($attachments) ) {
                        return '';
        }
    
        $selector = "gallery-{$instance}";

    I have not plenty understand the gallery’s logic, so i don’t adventure myself in deep analysis. It seems to me that the post__in value assigned to orderby parameter had serious implication, so i tweaked my code in standard wordpress 4.3.2 way, and now the image sorting works well. Intuition over comprehension.

    For sure the snippet i found was written for a previous version, and post__id option is not mentioned in current docs. The statement i found in Code Reference was

    ORDERBY – The field to use when ordering the images. Default ‘menu_order ID’. Accepts any valid SQL ORDERBY statement.

    I think this pretty important topic should be better documented…
    I was only able to find old hints regarding pre-3.5 code, and non-exhaustive ones, but tweak the way the galleries are shown is a priority i think, also in small projects.

    Surely my developer skill are not the best…

    Thread Starter fcornia

    (@fcornia)

    Ignore this

    I have also tried to change orderby parameter with others sortings, es. rand , menu_order ID (stated as default in current docs) , post__id (see in some discussions but not documented) but in my code it seems this parameter is totally ignored…

    The parameter orderby is working fine. The only issue is i can’t get the shortcode or visual editor ordering in gallery output.

    Thread Starter fcornia

    (@fcornia)

    Yes, i keep the plugin always updated… I have tried to deactivate Syntax Highlighter and add refresh the database record with no success.

    I think the issue could be due to utilization of SQLite DB. I have tried to deactivate your plugin, refresh DB rercord, and the html come back fine.

    Thank you for your support.

    Thread Starter fcornia

    (@fcornia)

    I forgot i was talking about posts created WHITOUT the multilingual support active.
    Create post while support is active and then deactivate it, will show the post in the loop, but that’s not the point.

    But i think i have resolved in this way:

    $loop = new WP_Query(array('post_type' => 'post', 'paged' => get_query_var('paged'), 'posts_per_page' => 10));
                                                while ( $loop->have_posts() ) : $loop->the_post();
    Thread Starter fcornia

    (@fcornia)

    Okay… it was a carelessness…
    in the line
    Template: Yoko
    the “Template” is not the template name but the template directory and need to be all lowercase, as the yoko’s theme directory…
    This thing is well descripted in http://codex.ww.wp.xz.cn/Child_Themes
    Now i don’t know why my local installation display correctly the child theme not listed correctly, but this is not important for me.

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