Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Can I just check that I am calling this correctly? I didn’t see any shortcodes for Scrollspy on the demo page on your website. So, is this how it would be coded?

    <!--Dot navigation -->
    <div id="sidebar">
    <?php dynamic_sidebar( 'Sidebar-1' ); ?>
    </div>
    
    <!-- ABOUT US - STATEMENT BLOCK -->
    
    <div id="wrapper" data-spy="scroll" data-target="#sidebar">
    <div id="firstbg" class="firststyle">
    <?php $my_query = new WP_Query( 'post_type=page&page_id=38' );
    if ($my_query->have_posts()) : while($my_query->have_posts()) : $my_query->the_post();?>
    	 <h1><?php the_title();?></h1>
    
    	 <?php the_content();?>
    
    <?php endwhile; endif; ?>
    <?php wp_reset_postdata();?>
    </div>
    
    <!-- BUSINESS MODEL-->
    <div id="secbg" class="secstyle">
    <?php $query2 = new WP_Query( 'post_type=page&page_id=40' );?>
    <?php if ($query2->have_posts()) : while($query2->have_posts()) : $query2->the_post();?>
    	 <?php the_content();?>
    
    <?php endwhile; endif; ?>
    <?php wp_reset_postdata();?>
    </div>

    Any help is greatly appreciated! Thanks for the plugin!

    Thread Starter deniseyap

    (@deniseyap)

    Okay, so after more trial and error I realised the link wasn’t displaying because of pagination problems, so I added a code to offset the page number, and now the links are actually showing up, but when I click “next”, the posts on uglyd.com/news/page/2 are the same as the posts on uglyd.com/news.

    This is the full code for my template:

    <?php
    /*
    Template Name: Blog
    */
    ?>
    
    <?php get_header(); ?>
    <style type="text/css">
    #phogallery .post ul li {
    	color: #b30838;
    	font-weight: normal;
    }
    </style>
    
    <div id="phogallery">
    <?php get_sidebar(); ?>
    
    <div class="post">
    
    <ul>
    <li>latest news</li>
    </ul>
    <?php
    	$args = array(
    		'cat' => '66',
    		'orderby' => 'date',
    		'order' => 'DESC',
    		'posts_per_page' => '10',
    		'paged' => '$paged'
    	);
    
    	$the_query = new WP_Query( $args );?>
    
    <?php $paged = get_query_var('paged'); ?>
            <?php $offset = 0;
            if ($paged != 0 ) {
                //$paged -1 because there is no page 1, just 0 and 2 And page 0 is skipped
                $offset = ($paged-1) * get_query_var('posts_per_page') ;
            } ?>
            <?php query_posts('offset=' . $offset); ?>
    
    <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    
    <a>">
    <pre><?php the_title() ;?></pre>
    </a>
    	<a>"> <?php the_post_thumbnail(array (580, 580)); ?></a>
    	<?php the_excerpt(); ?>
    
    <?php endwhile; ?>
    <?php previous_posts_link('previous'); ?>
    <?php next_posts_link('next'); ?>
    <?php wp_reset_postdata(); ?>
    <?php endif; ?>
    
    <?php get_footer(); ?>

    Thread Starter deniseyap

    (@deniseyap)

    Thanks, I have actually looked at those links and tested the solutions but still with no avail.

Viewing 3 replies - 1 through 3 (of 3 total)