WordPress.org

Ready to get started?Download WordPress

Forums

Spun
[resolved] Where to paste page to post solution? (6 posts)

  1. juanrose
    Member
    Posted 1 year ago #

    Hi

    Rxbxx managed to come up with a solution (reference) to link the circles to pages instead of posts?

    I tried to post the entire code in the thread into the index.php but it caused a syntax error? Which element of the code should be added and should it be added to the index.php or have I done that in error.

    Any help would be appreciated.

    Thank you in advance and excellent Theme Caroline!

  2. efi86
    Member
    Posted 1 year ago #

    an easy idea is to use the Quick Page/Post Redirect Plugin. just use the featured images of the post for the circles and when you click on the post it will redirect you to the page you set it to. I don't know if this is what you want exactly but it worked for me :)

  3. rxbbx
    Member
    Posted 1 year ago #

    He juanrose.. it's not that hard to solve. If you only want to have pages in stead of posts on your frontpage you have to edit the index.php file in the spun folder > wp-content\themes\spun\index.php

    <?php /* Display Pages */ ?>
    
    			<?php query_posts('post_type=page'); ?>
    
    			<?php if ( have_posts() ) : ?>
    
    				<?php /* Start the Loop */ ?>
    
    				<?php 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', 'home' );
    					?>
    
    				<?php endwhile; ?>

    Just add

    <?php query_posts('post_type=page'); ?>

    before the original loop starts..

    That way the circles display only the pages, nice for a website with only a few pages who doesnt want to blog or write articles. If you uncomment the main navigation you could even use it as main menu.

  4. new013
    Member
    Posted 1 year ago #

    Thank you rxbbx for the solution!! Works perfectly for me!!

  5. rxbbx
    Member
    Posted 1 year ago #

    Thnx new013 ... if you modify the code a bit you have several options. You can also specify which page in which order you want to have displayed.

    <?php $args = array('post_type' => 'page', 'order' => 'asc', 'post__in' => array(id nr page, id nr page, id nr page, etc)); query_posts($args); ?>

    There are many options with post_type=page..

  6. new013
    Member
    Posted 1 year ago #

    Thanks rrbx!!! I am new to PHP (am taking an online course to try to get a better handle on it) so I really appreciate your suggestions. Being about to order the pages is something that I want to do for sure so I will play around with the above code and see what I come up with. Thanks again for your help!!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic