Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • I realize this topic is 7 months old but I’m having the same issue. I’ve disabled all plugins and have tried both PHP 5.6.21 and 7.0.6 and am still having the same result.

    Here are the errors I’m receiving:

    Warning: Cannot modify header information - headers already sent by (output started at /domain-path/html/wp-content/plugins/post-types-order/include/class.options.php:40) in /domain-path/html/wp-admin/includes/misc.php on line 1126
    
    Warning: Cannot modify header information - headers already sent by (output started at domain-path/html/wp-content/plugins/post-types-order/include/class.options.php:40) in /domain-path/html/wp-includes/option.php on line 919
    
    Warning: Cannot modify header information - headers already sent by (output started at /domain-path/html/wp-content/plugins/post-types-order/include/class.options.php:40) in /domain-path/html/wp-includes/option.php on line 920
    Thread Starter thepeel

    (@thepeel)

    Thanks. I was afraid of that. My first go round didn’t work, but I went back and tried a combination of things and was able to get it to work.

    Thanks.

    Thread Starter thepeel

    (@thepeel)

    This certainly worked great and and solved many issues. Other issues jumped up in its place but overall this is very handy.

    Thread Starter thepeel

    (@thepeel)

    Trying this, but it keeps breaking the site. It’s also big and ugly.

    $args = array(
         'post_type' => 'posts',
         'tax_query' => array(
              'relation' => 'OR',
              array(
                   'relation' => 'AND',
                   array(
                        'taxonomy' => 'post_tag',
                        'field' => 'slug',
                        'terms' => 'tag-1'
                   ),
                   array(
                        'taxonomy' => 'post_tag',
                        'field' => 'slug',
                        'terms' => 'tag-2',
                   ),
              ),
              array(
                   'relation' => 'AND',
                   array(
                        'taxonomy' => 'post_tag',
                        'field' => 'slug',
                        'terms' => 'tag-1'
                   ),
                   array(
                        'taxonomy' => 'post_tag',
                        'field' => 'slug',
                        'terms' => 'tag-3',
                   ),
              ),
              array(
                   'relation' => 'AND',
                   array(
                        'taxonomy' => 'post_tag',
                        'field' => 'slug',
                        'terms' => 'tag-1'
                   ),
                   array(
                        'taxonomy' => 'post_tag',
                        'field' => 'slug',
                        'terms' => 'tag-4',
                   ),
              ),
         ),
    );

    I’ve now gone through all of the clients requested options and there are many different combinations. This is going to take awhile to figure out. Just for fun here they are.

    (tag-1 OR tag-2)
    (tag-1 AND tag-2)
    (tag-1 AND tag-2) OR (tag-3)
    (tag-1 AND tag-2) OR (tag-3 AND tag-4)
    (tag-1 OR tag-2) AND (tag-3 OR tag-4)
    (tag-1 OR tag-2) NOT (tag-3 OR tag-4)
    (tag-1 AND tag-2) NOT (tag-3 OR tag-4)
    (tag-1 AND tag-2) OR (tag-3) NOT (tag-4 OR tag-5)

    I’ll likely mark this resolved in the morning.

    Thread Starter thepeel

    (@thepeel)

    Thanks for the reply. I tried this earlier and my code looked almost identical, but your code works πŸ™‚ I think the only difference might have been that I am not sure if I was using slugs or not.

    So in your example, which has the relation outside, would I just add a third array to the tax_query to handle a not like so:

    $args = array(
      'post_type' => 'post',
      'tax_query' => array(
        'relation' => 'AND',
        array(
          'taxonomy' => 'post_tag',
          'field' => 'slug',
          'terms' => 'tag-1'
        ),
        array(
          'taxonomy' => 'post_tag',
          'field' => 'slug',
          'terms' => array( 'tag-2', 'tag-3', 'tag-4' )
        ),
        array(
          'taxonomy' => 'post_tag',
          'field' => 'slug',
          'terms' => array( 'tag-5', 'tag-6'),
          'operator' => 'NOT IN'
        ),
    );
    $query = new WP_Query( $args );

    So frustrating that I was so close all day and just mucked it up by something small. I eventually assumed that I couldn’t use post_tag twice.

    Also, in thinking about it, I’m trying to make it somewhat dynamic, any ideas on how to do it the first way with the ANDs grouped? This would allow me to setup repeater fields that could be pulled in dynamically, counted and turned into the query.

    Either way, thanks again! Very helpful and surprising it’s not out there somewhere already.

    I know this is marked as resolved but I’d like to know if there are any plans to implement this as it is something I am looking for as well.

    Thread Starter thepeel

    (@thepeel)

    After scouring this forum, I see that what I am doing is not how it was intended to be used. However, if we are unable to use it like this, then it makes GCB unusable for developing sites.

    I tested an old site with an older version of GCB and it worked just fine when running a search and replace.

    If there is no intention to make this work, please let me know so I can find a viable alternative.

    Thread Starter thepeel

    (@thepeel)

    I’m an idiot. Looking back I realize that’s how I did it before. Thanks for the quick response.

    Found this other post with the same problem and he had a solution which seems to be working for me in WP 3.3.1. Only difference is the line number in v1.1 is now 63.


    http://wordpress.org/support/topic/plugin-wp-columns-opening-tag-gets-left-out

    I love this plugin for it’s simplicty in handling columns. However, I’m currently having the same problem, I either get an extra, empty, set of p tags, or I’m missing the one for the first paragraph.

    What did you do to fix this? I’ve glanced at the code and am pretty sure I can add the first p tag, but I’m worried about any logic needed if my post doesn’t begin with a paragraph. For example I have one that begins with an unordered list. It would be odd to have that wrapped in the paragraph tag.

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