Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • There is a similiar thread here:

    https://www.ads-software.com/support/topic/299653

    The issue is happening to me also. I’ve downgraded to 1.62b to see how that works (I will know later this afternoon).

    I didn’t know the SQL, but I created a simple plugin that dumps a SQL trace to the screen whenever you edit a post. You could use this dump to pull the SQL statements you need:

    <?php
    /*
    Plugin Name: Spamboy SQL Trace
    Plugin URI: https://www.spamboy.com/
    Version: 0.1
    Author:	<a href="https://www.spamboy.com/">Spamboy</a>
    Description: Description goes here
    */
    
    // Functions
    function sb_sql_trace($post_ID) {
    	global $wpdb;
    
    	$sb_filename= '../SQL_trace_' . date("Ymd_His") . '.txt';
    	$sb_file = fopen($sb_filename, 'w') or die("can't open file");
    
    	if(SAVEQUERIES) {
    		foreach($wpdb->queries as $sb_query){
    			$stringData = $sb_query[0] . "\n\n";
    			fwrite($sb_file, $stringData);
    		}
    	}
    
    	fclose($sb_file);
    
    }
    
    // Actions
    add_action('edit_post', 'sb_sql_trace');
    ?>

    That’s a good point regarding existing URLs. It might make sense to request a change to the core code which generates filenames for medium-sized pictures, so that there’s some forward-compatability for users that switch themes in the future.

    Thread Starter Spamboy

    (@spamboy)

    Although it’s not a solution provided by calling a delivered function, digging around the link-template.php file gave me the means to a homegrown solution.

    I grabbed snippets of OOTB code and came up with this:

    <?php
    $sb_min_page = intval($wp_query->min_num_pages);
    $sb_max_page = intval($wp_query->max_num_pages);
    $sb_cur_page = intval($paged);
    ?>

    Then, at the beginning of my category archive I had the following code, which either will show a link to the previous page (if on a page above Page 1), or a placeholder for a link to the previous category (once I code it):

    <?php if ($sb_cur_page == $sb_min_page) {
    	echo "GO TO PREVIOUS CATEGORY";
    } else { ?>
    	<?php previous_posts_link('Previous Page') ?></div>
    <?php } ?>

    If anyone has a cleaner solution, I’m down with that.

    Can you post the code you used? I’m trying to do something similar on my site (show certain code only on the first and last pages of a category archive). Thanks!

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