Forum Replies Created

Viewing 15 replies - 31 through 45 (of 79 total)
  • Thread Starter NWTD

    (@nwtechie)

    Thanks again luistinygod!

    Thread Starter NWTD

    (@nwtechie)

    I was able to resolve this by adding this function:

    add_action( 'pre_get_posts', 'nwtd_lpfs_custom_admin_query' );
    function nwtd_lpfs_custom_admin_query( $query ) {
        if( !is_admin() && !$query->is_main_query() ) {
             return;
         }
         if( is_post_type_archive( 'services' ) ) {
              $query->set('no_found_rows', 1 );
              $query->set('update_post_meta_cache', 0 );
              $query->set('update_post_term_cache', 0 );
         }
    }
    Thread Starter NWTD

    (@nwtechie)

    Any suggestions from anyone else? — Maybe this is posted in the wrong forum. Should this be posted under “-Hacks”? If so, can a mod move it?

    Thread Starter NWTD

    (@nwtechie)

    Thanks phillibooth. I do have everything you suggested without the 3-4GB of memory.

    I’m trying to find some other solution rather than throwing a bunch of memory at the problem.

    I anticipate having a few other sites that will be of similar nature with the amount of posts and taxonomy terms….especially if any of these sites need to be edited simultaneously. I don’t want to run into a problem where I need 50GB of memory to run a dozen websites….there’s got to be a better solution.

    TIA

    Thread Starter NWTD

    (@nwtechie)

    Thanks for the helpful suggetions phillbooth.

    I’ve had most of these already in place, with the exception of using 2Gb of memory…it was previously set to 1Gb.

    After increasing to 2Gb I was able to view the posts, however, I see a slew of errors:

    WordPress database error: [MySQL client ran out of memory]
    SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('locations') AND tr.object_id IN
    WordPress database error: [Lost connection to MySQL server during query]
    SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN
    WordPress database error: [MySQL server has gone away]
    SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month FROM wp_posts WHERE post_type = 'services' ORDER BY post_date DESC

    Is there a way to alter this query so it’s not so heavy? It makes it difficult to manage these posts if I have to get to them from the front-end.

    FWIW, I did repair and optimize the tables, but according to that, everything was fine and already optimized.

    Thread Starter NWTD

    (@nwtechie)

    The problem with that solution is that each post is assigned to multiple taxonomy terms. So using <?php echo single_tag_title(); ?> just returns all taxonomy terms of that post.

    I’l like to just reference the one taxonomy term that was clicked on from the get go.

    To get a better idea, take a look at my example: http://chip-smith.com/dev2/areas-we-service/

    If you were to click on “Abbott, CA” (which is a taxonomy term), you are then taken to my page template taxonomy-locations.php and are shown all posts in that taxonomy term “Abbott, CA”. Clicking any post takes you to the single-services.php. In that ‘single-services.php`, I’d like to reference the queried taxonomy term…so in this case I want to display “Abbott, CA”.

    Hope that helps make more sense.

    Do you have an example of this working? I think I need to accomplish the same thing, but I’m not exactly sure. Thanks!

    Thread Starter NWTD

    (@nwtechie)

    I can’t seem to find much on the topic. Is the post 2 post relationship using a query? How might I reference that queried object. With something like get_queried_object()?

    Pardon my ignorance, I’m not great with PHP and am learning on the fly. I’d be happy to donate or pay for your assistance in helping me figure this out.

    Thread Starter NWTD

    (@nwtechie)

    I missed that in the documentation, my apologies. At quick glance and implementation, it seems that the shortcode just dumps out all connected locations of my service post. Is there a way to filter that output to only show the one location that was queried? Hopefully that’s not too confusing.

    Thanks for that fast response!

    Thread Starter NWTD

    (@nwtechie)

    On Problem 2, if the appendage of “-2” is unavoidable, could it be changed to be “-%taxonomyterm%”? So in that example, the output would be http://domain.com/victorville-ca/plumbing-victorville-ca

    Thread Starter NWTD

    (@nwtechie)

    Here’s my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /dev2/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /dev2/index.php [L]
    </IfModule>
    
    # END WordPress
    Thread Starter NWTD

    (@nwtechie)

    Thanks for the quick response and your time. I’ll give this a whirl and see where it takes me. I’m actually developing in the Genesis Framework, so I’ll have to tweak their loop a bit to get this to function.

    Thanks again.

    Thread Starter NWTD

    (@nwtechie)

    I apologize. I did not realize it had only been 24 hours.

    Your time and support are greatly appreciated.

    Please accept $20 worth of Karma.

    Thread Starter NWTD

    (@nwtechie)

    bump

    Thread Starter NWTD

    (@nwtechie)

    This ended up being an issue with the framework I’m using, Genesis. I had to us the genesis_get_custom_field('myfield') call for it to work.

Viewing 15 replies - 31 through 45 (of 79 total)