WordPress.org

Ready to get started?Download WordPress

Forums

Permalinks again! (33 posts)

  1. larkrise
    Member
    Posted 6 years ago #

    I have permalink woes, have scoured the forums and everywhere else but just can't seem to put my finger on the issue. I have gathered some hopefully useful information and still feel this is a simple issue. Please help if you can!

    If I change the permalink structure through Settings and choose say "/%year%/%monthnum%/%postname%/" then what I get is the correct structure showing in the address bar but where ever I click I just get my main blog page. So when I click "About" this shows "http://www.larkrise.net/about/" in the address bar but the content shows "http://www.larkrise.net/".

    I have installed AskApache RewriteRules Viewer 3.0 and it shows me:
    > Permalink: /%year%/%monthnum%/%postname%/
    > Writable .htaccess file found
    > mod_rewrite found
    > Not using pathinfo style index permalinks
    > Using mod_rewrite permalinks

    The WordPress Generated .htaccess Rules are:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    ...and I have a further list of tons of WordPress RewriteRules.

    So, can anyone help me to sort this out?!

  2. hotkee
    Member
    Posted 6 years ago #

    Have a look at your template to see what the actual link is - it may be hardcoded into the sidebar.php file (as is common practice with new themes)

  3. larkrise
    Member
    Posted 6 years ago #

    @hotkee thanks for your interest and the suggestion; this is a new theme (though I did not have a non-default structure before installing it). Could you guide me as to what to look for in sidebar.php and what to do about it?

  4. larkrise
    Member
    Posted 6 years ago #

    @hotkee, just starting to feel a glimmer of excitement over this! My sidebar.php looks like this (first bit at any rate):

    <div id="Sidebar">
    <div id="Sidebar-in">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    <?php /* Creates a menu for pages beneath the level of the current page - Thanks K2 Theme*/
    if (is_page() and ($notfound != '1')) {
    $current_page = $post->ID;
    while($current_page) {
    $page_query = $wpdb->get_row("SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
    $current_page = $page_query->post_parent;
    }
    $parent_id = $page_query->ID;
    $parent_title = $page_query->post_title;

    if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_status != 'attachment'")) { ?>

  5. hotkee
    Member
    Posted 6 years ago #

    whats the site url?

  6. larkrise
    Member
    Posted 6 years ago #

  7. hotkee
    Member
    Posted 6 years ago #

    Ok on the site now you have default permalinks which work, yes?

    Change them to the permalink you say doesnt work.

  8. larkrise
    Member
    Posted 6 years ago #

    @hotkee done (thanks)

  9. hotkee
    Member
    Posted 6 years ago #

    your permalink structure is just /%postname%/ ?
    change it to /%year%/%monthnum%/%day%/%postname%/

    or is it set to /%year%/%monthnum%/%day%/%postname%/ and its not coming up?

  10. larkrise
    Member
    Posted 6 years ago #

    @hotkee it is set to /%year%/%monthnum%/%day%/%postname%/

  11. hotkee
    Member
    Posted 6 years ago #

    Well it looks like a buggy theme - and from what I can tell its one you have paid for.

    Does the site work ok when the theme selected is default wordpress one?

    If it does, then you have a right to expect the theme developer to support you on this.

    In meantime, you could paste the whole sidebar.php code for people to look here if you want. The bit you pasted is not enough

    Can you also check that the date timestamp field for your pages is populated, say for the About page.

  12. larkrise
    Member
    Posted 6 years ago #

    OK, the full sidebar.php is below. I have contacted the theme supplier (yes, I did pay for this) & he assured me that this was not a theme issue! I tried a default WordPress theme but did have the same issue.

    <div id="Sidebar">
      <div id="Sidebar-in">
        <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
        <?php /* Creates a menu for pages beneath the level of the current page - Thanks K2 Theme*/
    		if (is_page() and ($notfound != '1')) {
    			$current_page = $post->ID;
    			while($current_page) {
    				$page_query = $wpdb->get_row("SELECT ID, post_title, post_status, post_parent FROM $wpdb->posts WHERE ID = '$current_page'");
    				$current_page = $page_query->post_parent;
    			}
    			$parent_id = $page_query->ID;
    			$parent_title = $page_query->post_title;
    
    			if ($wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$parent_id' AND post_status != 'attachment'")) { ?>
    
    	<!-- list Sub Pages-->
        <h2><?php echo $parent_title; ?> <?php _e('Subpages','k2_domain'); ?></h2>
    
    <ul>
          <?php wp_list_pages('sort_column=menu_order&title_li=&child_of='. $parent_id); ?>
        </ul>
        <?php } } ?>
    
    	<!-- list Categories-->
        <h2><?php _e('Categories'); ?></h2>
    
    <ul>
          <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
        </ul>
    	<!-- list Archives -->
        <h2><?php _e('Archives'); ?></h2>
    
    <ul>
          <?php wp_get_archives('type=monthly'); ?>
        </ul>
    <script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
    <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/larkrise.json?callback=twitterCallback2&count=5"></script>
    <div id="twitter_div">
    <h2 class="twitter-title">Twitter Updates</h2>
    <ul id="twitter_update_list">
    </div>
    
        <?php endif; ?>
      </div><!-- end #sidebar-in -->
    </div><!-- end #Sidebar -->
  13. hotkee
    Member
    Posted 6 years ago #

    Are you using any widgets?

    What I mean is are you going to Design -> Widgets in the admin screen and creating any widgets.

    By the looks of the sidebar code, it never gets executed instead widgets are being used I think.

  14. hotkee
    Member
    Posted 6 years ago #

    If you have the following plugin Sidebar Widgets installed, disable it and then try your site.

  15. larkrise
    Member
    Posted 6 years ago #

    I have the following Widgits in use: Pages, Recent Comments, two Text widgits (Do you want to stay, and Twitter) and Links. No I do not have the Sidebar Widgets plugin installed.

  16. hotkee
    Member
    Posted 6 years ago #

    Remove the widgets and try.

  17. larkrise
    Member
    Posted 6 years ago #

    Ok, removed all the widgits, but no change! Thanks a lot for your support...don't know how I am going to resolve this...guess just put up with the default permalinks.. but it keeps niggling me!

  18. iridiax
    Member
    Posted 6 years ago #

    Does your theme have a page.php? Are you using a seo or title tags plugin? Your titles in the browser bar are all the same and have a strange-looking | separator in front of them.

  19. hotkee
    Member
    Posted 6 years ago #

    Its very weird I have never seen such behaviour in wordpress.

    Once the widgets are removed, it should be running the above code and it does as the sidebar has changed but your permalinks stilll not working.

    Can you try permalink structure set to

    /%category%/%postname%/

    And final thing I can suggest is checking your .htaccess file (have you made any changes to it?)

  20. larkrise
    Member
    Posted 6 years ago #

    Changed structure as you suggest but no change.

  21. larkrise
    Member
    Posted 6 years ago #

    the .htaccess file is reading:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

  22. hotkee
    Member
    Posted 6 years ago #

    I am lost I am afraid, it just seems to be a problem with permalinks not workig when you have the numeric year/month etc in them.

    The only other permalink to try might be this one

    /archives/%post_id%

    which would look slightly better than the default one (if it works).

    I cant explain why your site is broken like that, hopefully someone else might have better ideas! :-|

    What about iridiax's thoughts above?

  23. larkrise
    Member
    Posted 6 years ago #

    @iridiax: yes my theme has page.php; not using those plugins; I picked up the little bar thing when I installed the favicon.

  24. larkrise
    Member
    Posted 6 years ago #

    @hotkee: tried /archives/%post_id% but no change. I wonder how far I need to deconstruct the blog to get back to something that works. Changing the theme did not do the trick. I will have to keep with the default permalinks but it is such a puzzle. I am really grateful for your engagement with this...maybe someone else will have another idea.

  25. hotkee
    Member
    Posted 6 years ago #

    Final thought I can offer is - whether you are using Windows as a server.

    There is some useful information on this page

    http://codex.wordpress.org/Using_Permalinks

    regarding Windows and Frontpage and permalinks not working.

    Till someone comes up with a solution, put your widgets back and reset to the default permalink - only option at the moment.

  26. larkrise
    Member
    Posted 6 years ago #

    I have tried every solution offered in the Using_Permalinks guide. I have just double checked and loaded the WordPress default theme & still have the issue even with numeric permalinks.
    The documentation talks about conflicts with Front Page server extensions. I did use these years ago but have deactivated everything that I did with Front Page (can't find a way to actually remove the folders that are still in my root directory, but I don't see how this can be significant).
    There seems to be no issue with the htaccess file (see the top of this thread). I wonder if anyone has any clues?

  27. iridiax
    Member
    Posted 6 years ago #

    ...and I have a further list of tons of WordPress RewriteRules.

    I'm guessing that your problem may be with these. Try using a fresh, default .htaccess file.

  28. larkrise
    Member
    Posted 6 years ago #

    @iridiax: Thanks..the thing is that the .htaccess file reflects the chosen permalinks and when I have the default setting the file looks like this:

    "# BEGIN WordPress

    # END WordPress"

    so surely the .htaccess file can't be the isssue??

  29. larkrise
    Member
    Posted 6 years ago #

    One other thing (if anyone is following this protracted thread!):

    When the default permalinks are working the address bar and the page title (as shown on the Firefox/IE tab) reflect the page address correctly; when any other permalink permutation is enabled the address bar shows the new structure but the tab only shows the root posts page.

    Does this give a lead to the problem?

  30. hotkee
    Member
    Posted 6 years ago #

    I thought the tab was correct with you changed the structure, it just wasnt working.

    Your earlier post showing .htaccess looked ok. Question was have you any other rewrites of urls going on somewhere?

    One other thing to attempt is to disable all plugins and try new structure (with your current and default themes).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags