• Resolved kikib

    (@kikib)


    I installed your plugin and reorder the posts within the category in the instructions/screenshots you provided. I even added it in the custom Wp_query like this:

    <?php
    $args = array (
    	'cat'              => 5,
    	'post_type' => 'galeria',
    	'posts_per_page' => -1
    );
    $the_query = new WP_Query( $args ); ?>

    However, it’s not showing the re-order that I arranged. I also cannot find any other documentation/ instructions on how to do that. Please provide me with instructions on how to show the re-order.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter kikib

    (@kikib)

    This is my full code in case you want to add custom required code to it:

    <?php
    
    $args = array (
    	'cat'              => 5,
    	'post_type' => 'galeria',
    	'posts_per_page' => -1
    );
    
    $the_query = new WP_Query( $args ); ?>
         <?php
        if ( $the_query->have_posts() ) : ?>
          <div class="article-wrap">
    <div class="masonry">
    <div id="gallery">
          <?php
          /* Start the Loop */
          while ( $the_query->have_posts() ) : $the_query->the_post();
    
    	?>
      <div class="brick">
    <a href="<?php the_permalink(); ?>" class="darken" title="Read the article &quot;<?php the_title(); ?>&quot;">
    
    				   <?php
    	if(has_post_thumbnail()) {                    
    	    $image_src = wp_get_attachment_image_src( get_post_thumbnail_id(),'full' );
    	     echo '<img src="' . $image_src[0]  . '" width="100%"  />';
    	} 
    	?>
    	 <span> <?php echo get_post_meta($post->ID, 'titleid', true); ?><br><?php echo get_post_meta($post->ID, 'locationid', true); ?>  </span> </a>
    			</div>
                
    	  <?php	
    
          endwhile;
          ?>
    Plugin Author Aurovrata Venet

    (@aurovrata)

    You cannot use cat with a custom post type in Wp_Query. You have to use a tax_query. Please refer to the documentation.

    Thread Starter kikib

    (@kikib)

    So if I made a category called “galleriaposts”. It should be displayed like this:

    <?php
    
    $args = array (
    	'post_type' => 'galeria',
    	'posts_per_page' => -1,
    	'tax_query' => array(
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'slug',
    			'terms'    => array( 'galleriaposts' ),
    		),
    	),
    );
    
    $the_query = new WP_Query( $args ); ?>

    correct?

    Thread Starter kikib

    (@kikib)

    Also it seems that it’s also not working because it’s conflicting with another plugin called Post Types Order.

    It seems that I do need those two plugins. I need to rearrange the posts itself in one order for one page (home page) and in different order for another page. Unless you can suggest a better alternative?

    It just that I thought it was a good idea to arrange the posts itself for one page and by category for another page…

    • This reply was modified 7 years, 7 months ago by kikib.
    Thread Starter kikib

    (@kikib)

    Never mind. I de-activated the other plugin, created a new category, and rearranged the posts order in each category and edited the custom query for each page. It all now works!!! Thanks so much!

    The only advice is that I would like for you to add this instruction to the plugin page because I couldn’t find this instruction anywhere on that page about adding tax_query.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Hi @kikib

    I am happy that it is now working.

    the use of the plugin is very simple and is explained in the screenshot section, however you are right that a written set of instructions would be useful, and I will add this for the next release.

    As for the tax_query, this is not related to the use of this plugin as such. It is std WordPress coding for custom post loads in page templates. You can the WordPress codex pages with all the instructions you need for that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Posts within Category isn’t showing the reorder, Help!’ is closed to new replies.