Forum Replies Created
-
AuthorPosts
-
jaychan
ParticipantHi,
I copied your code to Code Snippets and got error:
The code snippet you are trying to save produced a fatal error on line 3: syntax error, unexpected 'today' (T_STRING), expecting ';'
I did not make any change.
jaychan
ParticipantHi,
I tried but got error:
syntax error, unexpected 'today' (T_STRING), expecting ';'
Do you know what is the issue?
Thank you.
jaychan
ParticipantThank you.
jaychan
Participantjaychan
ParticipantThe original code is to reposition meta date from bottom to top, then I add condition to it.
Wondering if something wrong!
jaychan
ParticipantThank you for the source, search on that I found the solution: https://codex.wordpress.org/Function_Reference/has_term
jaychan
ParticipantHave you cleared W3 pagecache?
jaychan
Participant--
jaychan
Participant@Victor Font The post did not help but the comment below that provided many info and I was able do it.
Thank you for your help.
jaychan
ParticipantYes, work with the grid. But now I see another issue!
I've many scheduled posts, when a scheduled post is published, it no longer display at top because the code check 'modified date' of scheduled post, not 'publish date'
Is there a way for 'latest modified' and 'latest post' to work together?
Thank you.
jaychan
ParticipantThank you @braddalton
I tried to do it with Genesis loop but not successful. simplerthansimplest @WP.org just help me solve this. For anyone who need this later:
add_action( 'pre_get_posts', 'alter_query_to_show_modified_post_first' ); function alter_query_to_show_modified_post_first( $query ) { if($query->is_main_query() ) { $query->set( 'orderby', 'modified' ); } }
jaychan
ParticipantThis reply has been marked as private.jaychan
ParticipantYes, I first tried:
function genesis_grid_loop_args() { $args = array( 'orderby' => 'modified', ); }
and then:
function genesis_grid_loop_args() { $args = array( 'orderby' => 'modified', ); $query = new WP_Query( $args ); }
But none working! Did I miss anything?
Thank you.
jaychan
ParticipantI forgot to mention that I used Genesis Grid Loop: https://wordpress.org/plugins/genesis-grid-loop/
https://github.com/billerickson/Genesis-Grid/wiki
Could you please guide me how to archive the result without break the loop?
Thanks.
jaychan
ParticipantThank you @braddalton
Based on your suggestion, I found the function:
add_action( 'genesis_before_loop', 'ntg_do_query' ); function ntg_do_query() { global $query_string; query_posts( wp_parse_args( $query_string, array( 'orderby' => 'modified', 'order' => 'ASC' ) ) ); }
Is that correct?
Thank you.
jaychan
ParticipantNo, I moved the second nav to top, in replace for topnav, after the update everything become a mess and I cannot manage to fix it or get any help so I switched thing back, reverse the second nav bar but it's not completely fix.
As you can see in main site, the topnav (where to put date, RSS feed) disappear so it make the header look stranger! Can you advice how to get it back?
Thanks.
jaychan
ParticipantThis reply has been marked as private.jaychan
ParticipantHi Andrea,
Thank you for looking into this.
The site is NSFW so it may make you feel uneasy but I will try to explain more, hope you can help.
I use Page-Links split a single post up into different web pages by typing <!--nextpage--> in post.
http://codex.wordpress.org/Styling_Page-LinksBy default, the Page-Links located at bottom of the post, mean that visitors need to scroll down to move to a different.
now I want it to also available at top. Under post meta info would be perfect.
Thank you for your advice.
jaychan
ParticipantStill no luck with my searching, hope someone can help me on this. Thank you.
jaychan
ParticipantAmazing, it worked. 😀
Thank you very much.
-
AuthorPosts