Viewing 14 replies - 1 through 14 (of 14 total)
  • Is your news page meant to be a a page of posts or is it just a static page at the moment?

    Thread Starter egilarntzen

    (@egilarntzen)

    The news page is meant to be the page of posts. Like it shows when you open http://www.antonruuditerapi.no.

    Did you use code similar to the example at the page I listed above?

    Thread Starter egilarntzen

    (@egilarntzen)

    No my index.php looks like this:

    <?php get_header(); ?>
    		<div id="main">
        		<div id="content">
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div id="post-<?php the_ID(); ?>">
    
                    	<div class="terapi_icon"></div>
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                    	<h6><?php the_time('F, Y') ?></h6>
    
    				<div class="entry">
    					<h3><?php the_content(__('Les mer', 'Anton Ruud I Terapi')); ?></h3>
    				</div>
    
    					<p class="postmetadata">
    					<?php /*the_tags('Tags: ', ', ', '<br />');*/ ?>
                    	<?php /*the_category(' ') */?>
    					<?php edit_post_link('Edit', '', ''); ?>
    					<?php /*comments_popup_link('No Comments »', '1 Comment »', '% Comments »');*/ ?>
                    	</p>
                        <div id="line"></div>
    			</div>
    
            <?php endwhile; ?>
    
    		<div class="navigation">
    
    			<div class="nextpost"><h5><?php next_posts_link(__('Arkiv', 'Anton Ruud I Terapi')) ?></h5></div>
    			<div class="previouspost"><h5><?php previous_posts_link(__('Nye artikler', 'Anton Ruud I Terapi')) ?></h5></div>
    
    		<?php else : ?>
    
    		  	<h2 class="center">Not Found</h2>
            	<p class="center">Sorry, but you are looking for something that isn't here.</p>
            	<?php get_search_form(); ?>
    
        		<?php endif; ?>
    </div>
    </div>
    
    <?php get_sidebar('right'); ?>
    <?php get_footer(); ?>

    Why have you posted the code of your theme’s index.php template file? Is your site currently using a static front page with the News page selected as the main posts page in Settings -> Reading?

    Thread Starter egilarntzen

    (@egilarntzen)

    No i tried that. But I can’t use news as frontpage and postspage.

    I have three Pages:

    Nyheter (news)
    Kontakt (contact)
    Presse (press).

    The thing is my news-page is empty like it shows when you click on it.
    But if I delete that page I wont have it in my menu as I am using <?php wp_list_pages('title_li='); ?> to list my menu.

    Thread Starter egilarntzen

    (@egilarntzen)

    So my news page “page-9.php” has this code:

    <?php get_header(); ?>
    		<div id="main">
        		<div id="content">
    	<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div id="post-<?php the_ID(); ?>">
    
    				<div class="entry">
    					<h3><?php the_content(__('Les mer', 'Anton Ruud I Terapi')); ?></h3>
    				</div>
    
    					<p class="postmetadata">
    					<?php /*the_tags('Tags: ', ', ', '<br />');*/ ?>
                    	<?php /*the_category(' ') */?>
    					<?php edit_post_link('Edit', '', ''); ?>
    					<?php /*comments_popup_link('No Comments »', '1 Comment »', '% Comments »');*/ ?>
                    	</p>
                        <div id="line"></div>
    			</div>
    
            <?php endwhile; ?>
    
    		<div class="navigation">
    
    			<div class="nextpost"><?php next_posts_link(__('Arkiv', 'ostby')) ?></div>
    			<div class="previouspost"><?php previous_posts_link(__('Nye artikler', 'ostby')) ?></div>
    
    		<?php else : ?>
    
    		  	<h2 class="center">Not Found</h2>
            	<p class="center">Sorry, but you are looking for something that isn't here.</p>
            	<?php get_search_form(); ?>
    
        		<?php endif; ?>
    </div>
    </div>
    
    <?php get_sidebar('right'); ?>
    <?php get_footer(); ?>

    So your news page is not your main posts page? If so, then you need to create a custom page template using code similar to the examples in the page that I linked to above.

    Thread Starter egilarntzen

    (@egilarntzen)

    So I use the code from your link in my page-9.php?

    Something very similar yes but you’ll need to amend the query parameters/arguments to ensure that you’re pulling the posts that you want on that page.

    Thread Starter egilarntzen

    (@egilarntzen)

    I currently disable the custom permalinks settings, so now it displays my permalinks in the url.

    So my news page is now: http://www.antonruuditerapi.no/?page_id=4

    And I am working in page-4.php.

    Is this right? Cause nothing changes when I put in the new code… Even tried to make it blank and nothing changes.

    Sorry for these rookie questions. I really appreciate your help.

    Let’s start from scratch…

    What posts do you want to show on the News page? All of your posts or only those from (say) a specific category?

    Thread Starter egilarntzen

    (@egilarntzen)

    Everything. Just like the homepage. Basically I want news to be the same as the homepage.

    Thread Starter egilarntzen

    (@egilarntzen)

    Got it!

    Followed this tutorial http://www.wpbeginner.com/wp-tutorials/how-to-create-a-separate-page-for-blog-posts-in-wordpress/

    Thanks so much for your help, esmi!

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

The topic ‘Permalink issue’ is closed to new replies.