Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #201397

    TravelingIsAVerb
    Participant

    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

    #201623

    Christopher
    Moderator

    Thanks 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.

    #201662

    TravelingIsAVerb
    Participant
    This reply has been marked as private.
    #201911

    Rad
    Moderator

    Hi 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!

    #203470

    TravelingIsAVerb
    Participant

    Thanks, 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

    #203516

    TravelingIsAVerb
    Participant
    This reply has been marked as private.
    #203882

    Paul R
    Moderator

    Hi,

    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.

    #212017

    TravelingIsAVerb
    Participant
    This reply has been marked as private.
    #212309

    Nico
    Moderator

    Hi 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.

    #223677

    TravelingIsAVerb
    Participant
    This reply has been marked as private.
    #223864

    Rue Nel
    Moderator
    This reply has been marked as private.
    #224438

    TravelingIsAVerb
    Participant

    Sorry, 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.
    Thanks

    #224502

    Zeshan
    Member

    Hi 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.