-
AuthorPosts
-
February 7, 2015 at 10:33 pm #201397
Thanks to you all my web site is beginning to look like I want it to.
I created a child Ethos theme and with your help added a button to reorder posts.
My first blog page does show a button and a map. Is it possible for the next page to simply show the posts without the button and map (and without a side bar)
The other problem is that while the button works but I can’t get to the next page.
<?php $post_order = 'ASC'; if ( isset($_POST['last_order']) && $_POST['last_order'] == 'ASC' ) { $post_order = 'DESC'; } ?> <?php echo do_shortcode( '[wpgmza id="1"]' ); // ============================================================================= // VIEWS/GLOBAL/_INDEX.PHP // ----------------------------------------------------------------------------- // Includes the index output. // ============================================================================= $stack = x_get_stack(); if ( is_home() ) : $style = x_get_option( 'x_blog_style', 'standard' ); $cols = x_get_option( 'x_blog_masonry_columns', '2' ); $condition = is_home() && $style == 'masonry'; elseif ( is_archive() ) : $style = x_get_option( 'x_archive_style', 'standard' ); $cols = x_get_option( 'x_archive_masonry_columns', '2' ); $condition = is_archive() && $style == 'masonry'; elseif ( is_search() ) : $condition = false; endif; ?> <form method="post" action=""> <input type="hidden" name="last_order" value="<?php echo $post_order; ?>"> <input type="submit" value="Reverse Post Order"> </form> <?php if ( $condition ) : ?> <?php x_get_view( 'global', '_script', 'isotope-index' ); ?> <div id="x-iso-container" class="x-iso-container x-iso-container-posts cols-<?php echo $cols; ?>"> <?php query_posts($query_string . "&order={$post_order}"); if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php if ( $stack != 'ethos' ) : ?> <?php x_get_view( $stack, 'content', get_post_format() ); ?> <?php else : ?> <?php x_ethos_entry_cover( 'main-content' ); ?> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <?php x_get_view( 'global', '_content-none' ); ?> <?php endif; ?> </div> <?php else : ?> <?php query_posts($query_string . "&order={$post_order}"); if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php x_get_view( $stack, 'content', get_post_format() ); ?> <?php endwhile; ?> <?php else : ?> <?php x_get_view( 'global', '_content-none' ); ?> <?php endif; ?> <?php endif; ?> <?php pagenavi(); ?>
Thanks for all your help
February 8, 2015 at 8:52 am #201623Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
February 8, 2015 at 10:11 am #201662This reply has been marked as private.February 8, 2015 at 8:58 pm #201911Hi there,
You can wrap your button and map within this condition.
<?php if ( is_home() ) : ?> <!-- your button and map replacing this line --> <?php endif; ?>
And about the paging, I say it becomes more complicated. And you may need to contact a developer.
Paging is composed from query_var named page or paged passed by URL. So it’s basically re-writing the url to $_GET variable internally and get converted to query_vars
http://codex.wordpress.org/WordPress_Query_Vars
Your $_POST will not work as it only maintained on current page and On-Submit and not to the other page. So it will need reworked to include custom permalinks and custom query_var.
Eg. http://domain.com/blog/last_order/page/2/
Thanks!
February 10, 2015 at 2:55 pm #203470Thanks, that was what I was afraid of, and is obvious once I thought about it.
I have 20+ years of assembler, C, C++, Objective-C experience but no real PHP, so one question. I assume php is stateless, but is there anyway to create a “global” variable accessible from all pages?
Any recommendation on a good way to learn php in the wordpress context?
Thanks for all your help
February 10, 2015 at 3:52 pm #203516This reply has been marked as private.February 11, 2015 at 4:18 am #203882Hi,
You need to enclose your code in php tags.
You can try this
<?php if ( is_home() ) : echo do_shortcode( '[wpgmza id="1"]' ); endif; ?>
Hope that helps.
February 21, 2015 at 11:27 pm #212017This reply has been marked as private.February 22, 2015 at 11:00 am #212309Hi There,
Try adding this in your Customizer’s Custom CSS:
.blog .x-main .hentry:last-of-type{ border-bottom:none !important; }
Hope it helps!
Thanks.
March 9, 2015 at 2:50 pm #223677This reply has been marked as private.March 9, 2015 at 8:22 pm #223864This reply has been marked as private.March 10, 2015 at 12:21 pm #224438Sorry, my bad. I didn’t realize that you could turn off the footer widget area and that it took its color from the header. I actually will be adding content there so I adjusted colors appropriately. the problem I now face is the footer icons and text is white, and it doesn’t show up in the light gray footer. I’ve looked in the customizer and can’t seem to see when you can change the footer text and icon colors.
ThanksMarch 10, 2015 at 1:47 pm #224502Hi there,
To change the footer color, you can add following under Custom > CSS in the Customizer:
.x-social-global a, .x-colophon.bottom .x-colophon-content, .x-colophon.bottom .x-colophon-content a { color: #333; }
Hope this helps. 🙂
Thank you.
-
AuthorPosts