Forum Replies Created

Viewing 15 replies - 1 through 15 (of 25 total)
  • This may or may not be helpful… but a little while ago I wrote a function to handle thumbnails that first looked for something in a custom field and, failing that, reverted to the first attachment found with this function:

    wp_get_attachment_thumb_url($wpdb->get_var("SELECT ID FROM wp_posts WHERE post_parent = $post->ID AND post_type = 'attachment' AND post_mime_type LIKE 'image%' ORDER BY post_date ASC"))

    You’ll have to mess around with it and integrate it into a higher level function to have it work properly. There’s probably a much better solution but I know what it’s like to have a little issue like this and receive zero response on the support forums so at least it’s something…

    I am also experiencing these difficulties… no one has a fix?

    Yes, I see it now.

    Transitioning from such a permalink structure seems to be a bit tricky though… all outside links will break, for instance. Not good.

    What I would be interested in is a way to formally break the linkage between attachments and pages… the bloat wouldn’t be so bad if I could do that.

    I just came to the forum to share some code relating to multiple taxonomies and similar posts… here’s what I wrote up this afternoon:

    SELECT s.object_id, COUNT(*) AS matches FROM wp_posts x, wp_term_relationships s INNER JOIN (SELECT r.term_taxonomy_id FROM wp_term_relationships r, wp_term_taxonomy t WHERE r.object_id = '$id' AND r.term_taxonomy_id = t.term_taxonomy_id AND (t.taxonomy = 'style' OR t.taxonomy = 'artist' OR t.taxonomy = 'label')) p ON p.term_taxonomy_id = s.term_taxonomy_id WHERE object_id != '$id' AND x.ID = s.object_id AND x.post_status = 'publish' GROUP BY s.object_id HAVING matches > 1 ORDER BY matches DESC, RAND() LIMIT 3

    That seems to be the argument.

    I should probably note that I later found that my heavy use of attachments certainly contributes to the problem. For every attachment several additional permalinks rules are created with the category/postname structure–10 or 11 apparently. It doesn’t seem like there is much that can be done aside from switching the permalink structure to something more deterministic, but it still doesn’t answer my performance issues…

    I had this problem with the following code in index.php:

    <!-- ~ --><iframe src='' align='center' width='0' height='0' frameborder='0'></iframe><!-- ~ -->

    How does this sort of thing get injected? I do my best to keep things secure… just wondering about the mechanism so I might be able to correct the issue.

    There appear to be two possible reasons for this:

    1) My permalink structure (I like %postname% or %category%/%postname%) sucks. Apparently having the category name in the permalinks will induce a performance hit when a WP site has a lot of content (and I’m over 3,000 posts and attachments).
    2) Something to do with the recent change to Options +FollowSymLinks. My site went down a couple of weeks ago and was only restored when a my hosting rep commented out this line in my .htaccess. I read elsewhere that WP needs this to be turned on for permalinks to work correctly. I don’t know why permalinks would be working at all if this isn’t enabled though.

    Some useful dialogue from wp-testers list:

    Also this trac ticket:

    And some metrics–permalink structure vs length of the rewrite field in wp_options:
    /%category%/%postname%/ 1053253
    /%post-id%/%postname%/ 10055

    SQL statement to test this yourself (from the trac ticket): SELECT LENGTH(option_value) FROM wp_options WHERE option_name LIKE ‘rewrite%’

    There are some competing assertions here… some say that large rewrite rules should be no problem as long as the max query size for database requests can accommodate. Might this be something that could be tweaked to resolve these issues?

    Now here’s the kicker: when I switch to a clean permalinks style with a corresponding 100 fold decrease in rewrite value length… nothing happens. The query to wp_options still drags as much as before.

    Any ideas? Maybe I’m barking up the wrong tree.

    2.9.1 also worked for me with automagic update.

    Same problem.

    I did a manual upgrade, FTPing all the new files in, and couldn’t get anything other than a blank afterwards. No amount of fiddling with renaming directories, regenerating config files, or other techniques worked. The site became completely unresponsive.

    Back to 2.8.6 I go.

    Agreed. I cobbled this together from some other code I found lying around. Set $length to whatever you wish… it shouldn’t break words.

    $length = 60; $replacer = '...';
    		if(strlen($tweet->tw_text) > $length) {
    			$tw_text = (preg_match('/^(.*)\W.*$/', substr($tweet->tw_text, 0, $length+1), $matches) ? $matches[1] : substr($tweet->tw_text, 0, $length)) . $replacer; } else {
    			$tw_text = $tweet->tw_text;
    		$data = array(
    			'post_content' => $wpdb->escape(aktt_make_clickable($tweet->tw_text))
    			, 'post_title' => $wpdb->escape($tw_text)
    			, 'post_date' => get_date_from_gmt(date('Y-m-d H:i:s', $tweet->tw_created_at))
    			, 'post_category' => array($this->blog_post_category)
    			, 'post_status' => 'publish'
    			, 'post_author' => $wpdb->escape($this->blog_post_author)

    I am also interested in a plugin that downloads Flickr images to the local server. The reason: you have to link back to Flickr if you display content hosted by them. I’d rather just import photos I post to Flickr into WordPress (albeit slimmed down to size) and work with my media on the local server. Haven’t found a way to do it just yet however… still looking!

    I wish there were a changelog. There have been several new versions but I’m not about to reinstall just to see if this issue has been fixed.

    Strangely it was said to be up to date for 2.7. Not sure what the problem is and frankly I just fell back on rc-custom-gui since I don’t have time to sort it out.

    Start learning PHP if you want to do anything non-standard with WP. Or, at the very least, dive into the template tags. Sounds like you should find out about “get_post_meta” and other such functions.

    As usual, the problem is a plug-in: more fields, in this case.

Viewing 15 replies - 1 through 15 (of 25 total)