StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have -- and this forum will be removed on July 1st, 2013.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 09-15-2012, 12:12 PM
jjaycallejas jjaycallejas is offline
Registered User
Pro Plus Member
 
Join Date: Nov 2011
Posts: 154
Default Question about Archive query and Permalinks

Here's the page I'd like to discuss http://www.studio2055.com/dev/aero/?...p=alan-barge-2
and here's the code I used for the archive query at the top of the page (photos running at the top of the content)
PHP Code:
function _cpt_leadership_menu() {
    
$args = array(
        
'post_type' => 'aero_leadership',
        
'posts_per_page' => '-1',
    );
    
$tips = new WP_Query$args );
    if( 
$tips->have_posts() ):
        echo 
'<div class="leadership_menu">';
        echo 
'<div class="demo">';
            echo 
'<p>';
                while ( 
$tips->have_posts() ) : $tips->the_post();
                    echo 
'<a href="' get_permalink() . '">' get_the_post_thumbnail() . '</a>';
                endwhile;
            echo 
'</p>';

            echo 
'<script>';
                echo 
'jQuery(".demo img[title]").tooltip()';
            echo 
'</script>';
        
        echo 
'</div>';
        echo 
'</div>';
    endif;
    
wp_reset_postdata();

So I thought that posts are ordered by published date, however when I go and alter the publish date through the post editor, the order on the archive doesn't change, it still shows the posts in the order they were originally created. Does anyone know why? I ask this because the page I posted here, originally populated on the far right of the archive but I wanted it on the far left and thought changing the publish date would move it over.

Also, when I set a slug for a page, can I not ever use that on a different page? If you take a look at the slug of the page I posted, It says 2 at the end, even though I removed that same slug from another page that originally used it.

Thanks!
  #2  
Old 09-16-2012, 09:09 PM
NicktheGeek's Avatar
NicktheGeek NicktheGeek is offline
Forum Manager
 
Join Date: Feb 2010
Posts: 62,650
Default

you may want to define the orderly/order values for your query. Then you can control the sorting. If you can't use a slug make sure it isn't being used. Even if something is in the trash it will be reserved.
__________________
Nick "Fred and/or George Weasley" Croft
Designs by Nick the Geek
@Nick_theGeek on Twitter

Make web design easier, get FireBug for FireFox

Want to learn more about Genesis? Check out my Genesis Explained Series

  #3  
Old 09-16-2012, 09:40 PM
jjaycallejas jjaycallejas is offline
Registered User
Pro Plus Member
 
Join Date: Nov 2011
Posts: 154
Default

thanks for the response nick. Ill check that out. I was just concerned that the archive order was only dependent on order of creation (which it seems like it is). I'm guessing I have to explicitly query the order, by publish date? I was assuming that was the default, but I guess not. I'll go ahead and look more into it and report back.
  #4  
Old 09-16-2012, 09:47 PM
NicktheGeek's Avatar
NicktheGeek NicktheGeek is offline
Forum Manager
 
Join Date: Feb 2010
Posts: 62,650
Default

It is probably pulling by ID, which would be order of creation.
__________________
Nick "Fred and/or George Weasley" Croft
Designs by Nick the Geek
@Nick_theGeek on Twitter

Make web design easier, get FireBug for FireFox

Want to learn more about Genesis? Check out my Genesis Explained Series

  #5  
Old 09-17-2012, 11:47 AM
jjaycallejas jjaycallejas is offline
Registered User
Pro Plus Member
 
Join Date: Nov 2011
Posts: 154
Default

Ah, I see. That makes sense.

So I added this into the $arg array

PHP Code:
'order' => 'ASC' 
and adjusted the publish dates accordingly.

Although this works for now, it kinda seems like a round about way of ordering things. In the future I might try other ways of ordering posts.

Thanks!
  #6  
Old 09-17-2012, 12:11 PM
NicktheGeek's Avatar
NicktheGeek NicktheGeek is offline
Forum Manager
 
Join Date: Feb 2010
Posts: 62,650
Default

you can use orderby to set the sortable value. Like date, custom field ... all kinds of values can be used.
__________________
Nick "Fred and/or George Weasley" Croft
Designs by Nick the Geek
@Nick_theGeek on Twitter

Make web design easier, get FireBug for FireFox

Want to learn more about Genesis? Check out my Genesis Explained Series

 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query: Easy way to Hide a Page from showing up in Archive view? Naithin General Discussion 2 01-16-2011 02:50 PM
Author Archive / Permalinks internetgenius General Discussion 3 06-09-2009 11:51 AM


All times are GMT -5. The time now is 08:54 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.