WordPress.org

Forums

Category Widget - Drop down option- moved blog (3 posts)

  1. belton
    Member
    Posted 8 years ago #

    I'm quite new to using WordPress so apologies in advance...

    I use the categories widget in the sidebar to list my tags.
    I've moved the blog url from the installed folder to the root folder
    ie. to shiawase.co.uk (Blog address)
    from shiawase.co.uk/wordpress (WordPress address)
    making the appropriate changes in options.

    The category widget works ok when it's a list
    returning a correct url
    shiawase.co.uk/categoryname
    when it's a dropdown it returns
    shiawase.co.uk/wordpress/?cat=8 (or whatever the category ID is)
    and my server gives a
    "Forbidden -- You don't have permission to access /wordpress/ on this server"
    error message.

    If I edit the url in my browsers address bar to
    shiawase.co.uk/?cat=8
    it works

    I've found the code in widgets.php
    line 595 onwards

    <script lang='javascript'><!--
        var dropdown = document.getElementById("cat");
        function onCatChange() {
    		if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
    	        location.href = "<?php echo get_option('siteurl'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;		}
        }
        dropdown.onchange = onCatChange;
    --></script>

    But now I'm at a loss. Why isn't it generating the correct url? Everything else on my site seems to be working.
    I don't want to, but can I "hard code" the correct format into this file?
    or
    Where is it getting the option from? (get_option ('siteurl')
    is it getting the "WordPress address" rather than the "Blog address" ?

    Any ideas/ help?

  2. Pastinakel
    Member
    Posted 8 years ago #

    Use this script. It works. I'll submit this issue to http://trac.wordpress.org/

    <script lang='javascript'><!--
    var dropdown = document.getElementById("cat");
    function onCatChange() {
    if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
    location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
    }
    }
    dropdown.onchange = onCatChange;
    --></script>

  3. Pastinakel
    Member
    Posted 8 years ago #

    I reported this as a (small but annoying) bug: http://trac.wordpress.org/ticket/4683

Topic Closed

This topic has been closed to new replies.

About this Topic