Forum Replies Created

Viewing 15 replies - 91 through 105 (of 130 total)
  • Forum: Fixing WordPress
    In reply to: Too many pages?
    Thread Starter mikejandreau

    (@mikejandreau)

    I probably should have clarified:

    The main “single.php” template is used for all “news stories” that we post.

    Then we’ve got a second template “single-1344.php” which will be used for cast member pages.

    And a third “single-1302.php” which will be used for movie reviews.

    Because the cast and movie review pages have a lot of custom fields in them that are different from each other, and the default single page, I wanted them to display differently.

    I didn’t meant to insinuate that there’s 1450 templates being used, just 3 different ones.

    Forum: Fixing WordPress
    In reply to: Too many pages?
    Thread Starter mikejandreau

    (@mikejandreau)

    I think I solved my own problem.

    From my testing, all day, I learned that WordPress definitely handles posts and pages very differently, which is why I was running out of memory.

    The only reason, I realized, that I was using pages was so that I could utilize the custom template functionality of the pages. Then I realized I could do the same with posts, so why would it matter?

    I simple created a new single-$categoryid template, and added the following to my functions.php file for my theme:
    <?php add_filter('single_template', create_function('$t', 'foreach( (array) get_the_category() as $cat ) { if ( file_exists(TEMPLATEPATH . "/single-{$cat->term_id}.php") ) return TEMPLATEPATH . "/single-{$cat->term_id}.php"; } return $t;' )); ?>

    Now any file that’s a “single” post file, will pull single-categoryid.php as its template. Voila.

    Now I just hope WordPress can handle the thousands of posts I’m about to throw at it.

    Forum: Fixing WordPress
    In reply to: Too many pages?
    Thread Starter mikejandreau

    (@mikejandreau)

    I should also note than these 1450 pages have 5 custom fields, each.

    My postmeta table grew to over 20k rows, which I think may be what’s causing the issue in part.

    I deleted all those pages, and their corresponding metadata, and everything’s working fine now. But I need to find a solution so I can continue to grow the number of pages. We add about 1 page per day, and have been doing that for 3 years now.

    Forum: Fixing WordPress
    In reply to: Custom Query Issue
    Thread Starter mikejandreau

    (@mikejandreau)

    Nevermind, I got it.

    I just had to define what I wanted to use as the meta_value as a variable

    $variable = get_post_meta($post->ID, 'info', $single = true);

    I also used the same code to exclude the current page.

    $excluded = $post->ID;

    <?php
    
     $querystr = "
        SELECT DISTINCT wordpress_posts.*
        FROM $wpdb->posts wordpress_posts, $wpdb->postmeta wordpress_postmeta
        WHERE wordpress_posts.ID = wordpress_postmeta.post_id
        AND wordpress_postmeta.meta_key = 'tags'
        AND wordpress_postmeta.meta_value LIKE '%$variable%'
        AND wordpress_posts.post_status = 'publish'
        AND wordpress_posts.post_type = 'page'
    	AND wordpress_posts.ID !='$excluded'
        ORDER BY wordpress_posts.post_date DESC
     ";
    
     $pageposts = $wpdb->get_results($querystr, OBJECT);
    
     ?>

    And voila, it works! Thanks again for pointing me in the right direction.

    Forum: Fixing WordPress
    In reply to: Custom Query Issue
    Thread Starter mikejandreau

    (@mikejandreau)

    Nevermind, fixed the duplicate.

    Now, onto the other part I can’t figure out.

    How can I change AND wordpress_postmeta.meta_value LIKE '%test%'

    To reflect the current page title of the page someone’s viewing and exclude the current page they’re on from showing in the results?

    Thanks, again.

    Forum: Fixing WordPress
    In reply to: Custom Query Issue
    Thread Starter mikejandreau

    (@mikejandreau)

    Ugh. It’s always something so simple.

    post_type = post changed to post_type = page, and

    FROM $wpdb->posts posts, $wpdb->postmeta postmeta changed to
    `FROM $wpdb->posts wordpress_posts, $wpdb->postmeta wordpress_postmeta’ and voila.

    It’s still showing the posts twice though, even with SELECT DISTINCT, any suggestions there?

    Thread Starter mikejandreau

    (@mikejandreau)

    On second look, it seems like that’s going to work for me.

    I’ll just need to modify it to create pages, not posts, and accept templates for those pages, and I should be all set.

    Thanks MichaelH. I appreciate it.

    Thread Starter mikejandreau

    (@mikejandreau)

    That may work, but that plugin looks like it’s assuming I already have the pages all created, which I don’t.

    I’ll play around with it. It looks like it may be on the right track.

    If anyone else has a suggestion, I’m game to hear it.

    Then I don’t really see what the problem is.

    Your domain loads your WordPress blog.

    All links point to your main domain. So, it looks like you don’t need to do anything else. Unless I’m missing the point.

    Okay, that’s easy enough.

    1) Open FTP
    2) Download all your files from the subdirectory.
    3) Upload them to your domain’s root
    4) Go into your WordPress Admin panel
    5) Navigate to “Settings”
    6) Change WordPress address (URL) & Blog address (URL) from your subdomain to the mail domain.
    7) Delete the files from your subdomain in FTP.

    That should be it.

    Sociable is a great plugin to use.

    https://push.cx/sociable

    Will do all that, and more, right out of the box.

    HalP, can you clarify? What is it you’re trying to accomplish?

    Your hosting provider should provide phpMyAdmin to you. You don’t need to install it yourself in most cases.

    Right, you’d need to login to your database (presumably through phpMyAdmin).

    Navigate to the database you have WordPress installed in, and click on “wp_options” in the left hand pane of phpMyAdmin.

    That’ll load all the rows in that table, and allow you to edit what you want to.

    Depending on what you want to edit, you should be able to edit it through the Admin panel. (Unless that doesn’t work, of course)

    Forum: Plugins
    In reply to: WP-Amazon

    Upgrade from 2.3 to 2.6.1 and use Amazon Reloaded. It does exactly what you want.

    This fix seems to have worked for me, temporarily.

    Now, I get the error the first time a page is loaded. Refreshing makes it go away. But any differet pages being loaded result in that same error until refreshed.

    I should also note that the pages that result in the error are pages *outside* of WordPress, that I include the WordPress header in, and execute a “recent comments” plugin.

    Any suggestions?

Viewing 15 replies - 91 through 105 (of 130 total)