• I have a Recent Post section show up on every page I create. Is there any way to scrap these? Since I use some of these pages on my parallax sections, the Recent Posts show up several times, which is incredibly annoying. In fact, I cannot believe that such a setting is set by default.

    Any advice is appreciated.

Viewing 11 replies - 1 through 11 (of 11 total)
  • This is probably a loop built-into your theme. Check your single.php and page.php files, there’s probably chunks of code at the bottom of these templates that build the loop, or call the function.

    Thread Starter gandalf3

    (@gandalf3)

    Is there a way to access these from WP admin? I am using a hosting and have limited access to files (obviously).

    Yep. inside your dashboard, click appearance>>>editor. The list of files for your theme will be on the right.

    Be careful while editing in there. one misplaced character can make your entire site not load. It would be wise to copy and paste the code as-is locally before making any edits so you can always put the original code back in to fix the site if you botch it.

    Thread Starter gandalf3

    (@gandalf3)

    So I only have functions.php and styles.css on the list. However, it seems to only allow additional edits to be placed there rather than modify the original files. Does it make a difference if I am using a Child Theme? That is, I created a Child using Childify.

    Yep, that matters. Odds are your parent theme is what has the files I mentioned above. You shouldn’t edit the parent theme directly, though. If the developer makes an update to your theme, it will override the settings you apply to the parent theme, but it does not touch the child theme. (This is why child themes exist!)

    I don’t know if Childify can do this for you, but you need to copy single.php and page.php to the child theme. If it can, great, do that. Otherwise, you’ll need to get access to the file structure so you can copy the single.php and page.php files to the child theme. Once they’re copied, you can make the edits needed to override the parent theme files, which will get rid of the related posts settings.

    Thread Starter gandalf3

    (@gandalf3)

    I see. But how do I get those files to show up in the child theme editor? Also, if I posted the contents of those files from the parent theme, would you be able to point me at the right place? I am not too well-versed in WP code. But I do know some PHP.

    The files will get added to the child theme editor once you add them to your child theme folder. You don’t see them in the child theme editor because they don’t exist in that theme (instead, WordPress is looking to the parent theme for these files, which is why we need to copy them over to your child theme).

    https://codex.wordpress.org/Child_Themes

    Sure, feel free to post it here. I’ll take a peek at it.

    Thread Starter gandalf3

    (@gandalf3)

    Got it. Would I need to ask the hosting people to do it in this case?

    Thread Starter gandalf3

    (@gandalf3)

    Page.php

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package accesspress_parallax
     */
    
    get_header(); ?>
    
    <?php
    if(of_get_option('enable_parallax') == 1 && is_front_page() && get_option( 'show_on_front' ) == 'page'){
    	get_template_part('index','parallax');
    }else{
    ?>
    
    <div class="mid-content clearfix">
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    
    			<?php
    			global $page;
    			if(of_get_option('enable_parallax') == 0 || is_singular()): ?>
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', 'page' ); ?>
    
    				<?php
    					// If comments are open or we have at least one comment, load up the comment template
    					if ( comments_open() || '0' != get_comments_number() ) :
    						comments_template();
    					endif;
    				?>
    
    			<?php endwhile; // end of the loop. ?>
    			<?php else:
    
     			echo wpautop($page->post_content); 
    
    			endif; ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    </div>
    <?php } ?>
    
    <?php get_footer(); ?>
    Thread Starter gandalf3

    (@gandalf3)

    single.php

    <?php
    /**
     * The template for displaying all single posts.
     *
     * @package accesspress_parallax
     */
    
    get_header(); ?>
    <div class="mid-content clearfix">
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    
    		<?php while ( have_posts() ) : the_post(); ?>
    
    			<?php get_template_part( 'content', 'single' ); ?>
    
    			<?php
    			$post_pagination = of_get_option('post_pagination');
    			if( $post_pagination == 1 || !isset($post_pagination)) :
    			accesspress_parallax_post_nav();
    			endif;
    			?>
    
    			<?php
    				// If comments are open or we have at least one comment, load up the comment template
    				if ( comments_open() || '0' != get_comments_number() ) :
    					comments_template();
    				endif;
    			?>
    
    		<?php endwhile; // end of the loop. ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>

    hmmm….no. It doesn’t appear to be there. Sorry, I’m not sure where they’re putting the code to build that related posts section. It might be in your parent theme’s functions.php somewhere. Can you ask the theme developer directly? They’re probably going to be who you need to go to.

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

The topic ‘[Theme: Accesspress Parallax] Removing Recent Posts Section’ is closed to new replies.