Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • the_permalink() only works within the post also – hence your link not working. The only way I’ve found to do this is to rebuild the address from the php $_SERVER variables

    Just the inspiration I needed!
    I’d suggest a small tweak though – this current code works out what the slug should be by sanitising the query variable (which I believe could be anything coming from the URL rewrite) then looks up the category name and turns that into what should be the slug.

    However the actual slug doesn’t always equal the sanitised name as you can edit the slugs in the admin.

    The following tweak will get the actual slug assigned to that category from the database:

    <?php
    add_filter('category_template','my_category_template_filter');
    function my_category_template_filter($template){
        $cid = absint( get_query_var('cat') );
        $cat = get_category($cid);
        $file = TEMPLATEPATH.'/category-'.$cat->slug.'.php';
        return (file_exists($file)) ? $file : $template;
    }
    ?>

    It shouldn’t need sanitising as its already been cleaned before writing to the db.

    I believe the syntax has now changed (wordpress 2.8 – not sure when media.php was altered though, may be earlier)
    Now in your functions.php it should be:

    $content_width = 800;

    This would be great for me as well – did you ever track one down?

    Also check Settings > Miscellaneous to see what your upload path is, this won’t be a url, instead it will be a local directory path on the hosting server – something like “/home/username/mainwebsite_html/wp-content/uploads”, try the default that wordpress suggests first on that screen.

    If that doesn’t work you’ll have to login to your hosting control panel/use your ftp program to figure out the actual path.

    I just moved a blog from one host to another and – woops – forgot to change this setting for the new host, got exactly this error.

    In the search results template page try adding
    <?php $wp_query->init(); ?> immediately after the end of the search loop. Search Everything overides the global $wp_query object and so may impact other loops/code on the page after its called – I’ve only just discovered this myself so I’ve not tested this solution in many scenarios yet, but so far its working for me.

    Unfortunately in this release (3.2) of the plugin I can’t find the “Keep empty paragraphs..” checkbox.

    The possibly similar checkbox that does exist is the “Stop removing the <p> and…” option. Turning this off does stop the problem, but also loses that functionality.

    Ironically the only reason I use TinMCE advanced is for this functionality – so I can write br and <p> tags in the HTML editor as I see fit.

    So back to the drawing board…

    I’m having the same problem with 2.7.1
    I’ve tried the “Fix Paging in Category Listings” plugin but that was no help.
    The quick word around I put in place was to add in a Category base, the URL’s aren’t so pretty, but the addition of a category base seems to fix the problem when paginating (ie is ‘page’ a post or a querystring parameter??).

    eg Permalink structure:
    /%category%/%post_name%/
    Category base:
    info
    Resulting Paged URL:
    https://…/info/portfolio/page/2/

    …weirdly further testing has shown that once I’ve added the Category base, URLs without it are now working eg https://…/portfolio/page/2/ – yet the .htaccess code remains unchanged.

Viewing 8 replies - 16 through 23 (of 23 total)