WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks and static front page (7 posts)

  1. karlong
    Member
    Posted 4 years ago #

    Hello,

    I've developed a website using WordPress as a CMS (see http://americancontrol.net) . The front page is static and the posts page is the link in the sidebar titled "CSI: CONTROL SYSTEM INVESTIGATOR".

    When I turn on custom permalinks (day and name) the pages work fine, but the posts page is funky.

    If you click on the posts page (CSI) directly from the front page it's fine, except instead of having the pretty permalinks it looks like this:
    http://americancontrol.net/?page_id=96

    However, if you click on a static page first, say, CAREERS, and then click on CSI, the URL appends "?page_id=96" to "careers" like so: http://americancontrol.net/careers/?page_id=96, and this causes the page to 404. All links clicked after this are funky.

    Permalinks work fine if I use the default theme, so it's something with my theme, but I'm at a loss as to where to look or search. Is it something to do with making the front page static and putting the posts on an internal page?

    Any solutions or ideas are much appreciated!

    Thanks in advance,

    Karen

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Sounds more like it's a problem with the sidebar. What are you using to generate the CSI link in the sidebar?

  3. Samuel B
    moderator
    Posted 4 years ago #

  4. karlong
    Member
    Posted 4 years ago #

    This is the html for the CSI link in the sidebar:

    <h2><a href="index.php?page_id=96">CSI: CONTROL SYSTEM INVESTIGATOR</a></h2>

    If it makes any difference, I'm calling in custom sidebars for various static pages with conditional statements in index.php (outside the loop):

    <?php
    if ( is_front_page() ) :
      	get_sidebar();
    elseif ( is_page('77') ) :
    	include (TEMPLATEPATH . '/sidebar_about.php');
    elseif ( is_page('96') ) :
    	include (TEMPLATEPATH . '/sidebar_csi.php');
    elseif ( is_page('101') ) :
    	include (TEMPLATEPATH . '/sidebar_furnace.php');
    elseif ( is_page('103') ) :
    	include (TEMPLATEPATH . '/sidebar_control.php');
    elseif ( is_page('105') ) :
    	include (TEMPLATEPATH . '/sidebar_control.php');
    elseif ( is_page('107') ) :
    	include (TEMPLATEPATH . '/sidebar_daq.php');
    elseif ( is_page('94') ) :
    	include (TEMPLATEPATH . '/sidebar_bob.php');
    elseif ( is_page('342') ) :
    	include (TEMPLATEPATH . '/sidebar_save.php');
    else :
    	include (TEMPLATEPATH . '/sidebar_interior.php');
    endif;
    ?>

    I'm on a Linux server with Apache mod_rewrite enabled. The .htaccess file is in the WordPress root folder (should it be in the theme directory?) Permalinks work fine with the default theme, so I think .htaccess is okay, but here's the code:

    AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
    AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    AuthName "Restricted Area"
    AuthUserFile "/home/ameri231/.htpasswds/public_html/passwd"

    Thanks for your help!

    Karen

  5. karlong
    Member
    Posted 4 years ago #

    Note: I'm working on the site right now, so you may not be able to see it, or it might behave oddly (this is a testing site at the moment).

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    The .htaccess looks fine. What's in sidebar_csi.php?

  7. karlong
    Member
    Posted 4 years ago #

    See code below for sidebar_csi.php. Also, since the site has now gone live I've turned off the permalinks until I resolve this issue, but you can see the site sans permalinks at theacesinc.com/.

    Thanks!

    Karen

    <div id="sidebar">
    
        <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>
    
        <div class="csi-leadin2">
    
    <h2><a href="index.php?page_id=94">FEATURED PROJECT</a></h2>
    <h3>A REAL-TIME DATA ACQUISITION SYSTEM IN ACTION</h3>
    
    	</div>
    
        <div class="csi-leadin2">
    
    <h2><a href="index.php?page_id=96">CSI: CONTROL SYSTEM INVESTIGATOR</a></h2>
    <h3>ACES ENGINEERS SOLVE CASES IN THE FIELD</h3>
    
    	</div>
    
           <div id="search">
    
    		<form role="search" method="get" id="searchform" action="http://theacesinc.com" >
    	<label class="screen-reader-text" for="s"></label>
    	<input type="text" value="" name="s" id="s" />
    	<input type="submit" id="searchsubmit" value="Search" />
    	</form>	
    
       	</div>
    
    <h2>SERVICES</h2> 
    
    <ul id="sidebarnav">
    
    <li><h3><a href="index.php?page_id=101">FURNACES AND OVENS</a></h3></li>
    
    <li><h3><a href="index.php?page_id=103">CONTROL SYSTEMS</a></h3></li>
    
    <li><h3><a href="index.php?page_id=105">MUNICIPAL WATER</a></h3></li>
    
    <li><h3><a href="index.php?page_id=107">DATA ACQUISITION SYSTEMS</a></h3></li>
    
    <li><h3><a href="index.php?page_id=242">ROBOTICS &AMP; MOTION</a></h3></li>
    
    </ul>
    
    <h2>CAREERS</h2> 
    
    <ul id="sidebarnav">
    
    <li><h3><a href="index.php?page_id=109">CONTROL ENGINEER</a></h3></li>
    
    <!--<li><h3><a href="index.php?page_id=111">ELECTRICAL ENGINEER</a></h3></li>
    
    <li><h3><a href="index.php?page_id=113">ELECTRICAL DESIGNER</a></h3></li>-->
    
    </ul>
    
    <img id="logos" src="http://theacesinc.com/wp-content/themes/Sandbox/images/logos_rotating.gif" width="180" height="101" alt="We're liscensed distributers for Allen-Bradley, Eurotherm Chessell and Siemens">
    
        <?php endif; ?>
    
    	</ul>    
    
    </div>

Topic Closed

This topic has been closed to new replies.

About this Topic