Support » Theme: Vantage » pagination does not work

  • Resolved Geycer

    (@geycer)


    I have created a child theme, I have created a page but the pagination does not work, although it shows me well but it does not advance, it continues at 1, although in the menu it shows me page2, page3, etc.

    
     <?php
    /**
     * Template Name: azhar
     *
     */
    
    get_header(); ?>
     
            <div id="primary" class="content-area">
                <div id="content" class="site-content" role="main">
                
                <?php if ( have_posts() ) : ?>
    
                    <?php vantage_content_nav( 'nav-above' ); ?>
    
                    <?php /* Start the Loop */ ?>
                    <?php
                    query_posts(array('orderby' => 'rand', 'showposts' => 7, 'cat'=>-629));
                    while (have_posts ()): the_post();
                    ?>
                    <?php
                            /* Include the Post-Format-specific template for the content.
                             * If you want to overload this in a child theme then include a file
                             * called content-___.php (where ___ is the Post Format name) and that will be used instead.
                             */
                            get_template_part( 'content', get_post_format() );
                        ?>
                            
                    <?php endwhile; ?>
                    
                    
                <?php else : ?>
    
                    <?php get_template_part( 'no-results', 'index' ); ?>
    
                <?php endif; ?>
                
                <?php get_template_part( 'loops/loop', siteorigin_setting( 'layout_search' ) ); ?>
             
                    
                
                </div><!-- #content .site-content -->
            </div><!-- #primary .content-area -->
            
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    
    • This topic was modified 8 months, 3 weeks ago by Geycer.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi, thanks for reaching out.

    The pagination is functional, the posts are changing as is the URL. The current class isn’t shifting to the appropriate link. I’m not sure why that is, I can’t replicate it locally. Try to seek a working baseline by temporarily switching to the parent theme, does the issue resolve? If not, switch to the parent theme and deactivate all plugins not authored by SiteOrigin, does the issue resolve?

    Thread Starter Geycer

    (@geycer)

    In the initial page (home) where I show by default about 10 entries all work correctly, in this page it has the condition of random, that is why if I advance to another page I will never know if it really changed, something in my coding is wrong

    Do you perhaps have Page Builder by SiteOrigin installed? If so, you could create this page and the query using the Post Loop widget.

    Thread Starter Geycer

    (@geycer)

    Another thing that I realize is that I must show 7 post, but it shows me twice and repeated, from 8 to 14 it is the same as from 1 to 7

    A SiteOrigin Post Loop widget would be an easy method of creating a custom loop with queries without the need for a page template.

    Thread Starter Geycer

    (@geycer)

    You’re very right friend, but how do I make him take random post

    Thread Starter Geycer

    (@geycer)

    It could be said that you were very right with the widgets, how better that double box appearance that appears now in each post? There is a general box that I want to eliminate

    https://frasescristianas.org/imagenes/page/3/

    You can use the Order by setting to select Random order.

    You’ll need to make your CSS more specific. You are targetting .entry-content, a more specific rule would be something like .panel-layout .entry-content.

    Thread Starter Geycer

    (@geycer)

    Hi Andrew, I did the random post thing, I tried the class .panel-layout .entry-content {without any results, I have created a new class .entry-content2 {and I have applied it to content.php

    <div class="entry-content2">
    				<?php if ( siteorigin_setting( 'blog_archive_content' ) == 'excerpt' ) the_excerpt(); else the_content(); ?>
    				<?php $read_more_text = siteorigin_setting( 'blog_read_more' ) ? esc_html( siteorigin_setting( 'blog_read_more' ) ) : __( 'Continue reading', 'vantage' ); ?>
    				<?php echo ( ( siteorigin_setting( 'blog_read_more_button' ) && siteorigin_setting( 'blog_archive_content' ) == 'excerpt' ) ? '<a class="more-link" href="' . get_permalink() . '">' . $read_more_text .'<span class="meta-nav">&rarr;</span></a>' : '' ); ?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'vantage' ), 'after' => '</div>' ) ); ?>
    				
    				<div class="pie-cuadro">
    				<?php if ( 'post' == get_post_type() ) : ?>			 		
    		<span>Categ: <?php the_category(' '); ?></span>				
    		<?php endif; ?>				
    		<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>				
    		<span class="sep"> | </span>				
    		<span class="comments-link">
    		<?php comments_popup_link( __( 'Comentarios', 'vantage' ), __( '1 Comment', 'vantage' ), __( '% Comments', 'spirit' ) ); ?>
    		</span>				
    		<?php endif; ?>    		 		
    		<span class="sep"> | </span>		<?php the_tags('+ de: ');?>				
    		<?php edit_post_link( __( 'Editar', 'vantage' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>		
    		
    
    		</div>
    			</div><!-- .entry-content2 -->
    

    The result is almost good, the bad thing is that the class class = “pie-cuadro” is outside the border, would that be the solution? since I didn’t understand much about the .panel-layout .entry-content

    The rule I was referring to is in your style.css file. You’re targetting .entry-content but in a post loop .entry-content is used for each post. We’re here to help with any standard usage questions you may have but unfortunately, can’t assist too much with custom development due to our limited resources.

    In your child style.css, you have a rule targetting .entry-content, if you don’t want that to target each instance of entry-content in the post loop you could try changing the rule to something like:

    .entry-header > .entry-content {
    }
    Thread Starter Geycer

    (@geycer)

    Thank you very much friend for all the direction and help provided, perhaps it is the last thing I ask you, I want the border to be shown in each post but not a general border to all the entries, I hope it is understood, if I show 7 post it comes out a general border too, that I want to remove.

    Have you tried the advice I’ve provided above? Change .entry-content to .entry-header .entry-content { }

    Thread Starter Geycer

    (@geycer)

    Yes, I tried it friend, there is no change

    Perhaps try adding:

    .panel-layout .entry-content {
    	border: none;
    	box-shadow: none;
    }
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘pagination does not work’ is closed to new replies.