Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Thank you

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Well that stinks. Ok, I guess that means I move onto plan B. Thank you for the help.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Just found Yoast’s post looking for certain information:

    WordPress version: 3.3.2
    WordPress SEO version: 1.2.8.1

    I did this: Installed the plugin and a chunk of my .htaccess file went missing

    I expected the plugin to do this: Not change my .htaccess file unless I changed it.

    Instead it did this: It removed a large section from my .htaccess file.

    I did a little more digging and confirmed that activating the plugin triggers this. I even installed a new installation of WordPress, version 3.4.2 and installed only WordPress SEO by Yoast, getting the same result. I also tried the development version, getting the same result.

    I cannot figure out if there are any other triggers. This has happened twice to my live version, the first time being when the plugin was activated and the second with some unknown trigger. Since there are multiple contributors, authors and admins on my site, there is no way of telling who triggered it or how they triggered it.

    Any help on this would be much appreciated. Thank you.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    It took me a while but I figured it out, I just placed this in mu functions.php file:

    function remove_se_filters($query) {
    
      if($query->is_feed && $query->is_category){
        global $wp_filter;
    
        foreach($wp_filter['pre_get_posts'][999] as $key=>$filter){
          if(strpos($key, 'se_filters') !== false){
            unset($wp_filter['pre_get_posts'][999][$key]);
          }
        }
      }
    
      return $query;
    }
    
    add_filter('pre_get_posts','remove_se_filters');

    I found that I couldn’t use the remove filter function because I did not have access to the original class variable that was used to set the filter in the first place so going into the filer’s global variable and unsetting the array manually was the next best option.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Sure. Here you go:

    function smb_find_occurences($string, $find) {
      if (strpos(strtolower($string), strtolower($find)) !== FALSE){
        $pos = -1;
        for ($i=0; $i<substr_count(strtolower($string), strtolower($find)); $i++){
          $pos = strpos(strtolower($string), strtolower($find), $pos+1);
          $positionarray[] = $pos;
        }
        return $positionarray;
      }else{
        return false;
      }
    }
    $image_positions = smb_find_occurences($content, '<img');
    if(count($image_positions)){
      if(count($potential_random_ad_paragraphs)){
        foreach($potential_random_ad_paragraphs as $key=>$potential_random_ad_paragraph){
          foreach($image_positions as $image_position){
            if(abs($image_position - $original_paragraph_positions[$potential_random_ad_paragraph-1]) < 600){
              unset($potential_random_ad_paragraphs[$key]);
            }
          }
        }
      }
    }

    I inserted this section of cod into line 869 in ad-injection.php. Sorry if it is a little crude, I was going more for time rater then efficiency. There are probably some better ways to determine image position in the content, as the method I used does not take into account the length of the image tag.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Ya, but it doesn’t work for what I want to do, plus it is nice to have a little word space between the ads and the images to avoid clutter. With that, I just added a little hack in order to give myself a 600 character buffer between the ads and the images. Thank you anyways.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    That was it. I do have Sitewide Tag Pages installed on the site and I was trying to exclude the ids for the post in the blog set up by Sitewide instead of the original blog post’s ID. Once I figured that out is was easy to get the correct IDs and exclude them. Thank you for all the help. sorry about the newbish questions, I just inherited the site a few months ago and I’m still learning all of the ins and outs of this installation of WordPress.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    I am setting $displayed_posts right above that function. What I am doing is that I am creating a home page that fist display the most recent 6 articles from every blog. As I am displaying those articles, I am taking their post ID and entering it into that array.

    $displayed_posts[] = $post->ID;

    I then want to go through every section and display the next 4 articles. I want to exclude any post that I have already displayed. No need for duplicate links on the same page.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Figured it out. I just created db-error.php in wp-content and added some code that would email me every time a database error occurred. While I was at it, I spruced up the database error message to make it look like the site was just busy rather then there are database problems.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Alright I got the directory listing to work if I add Options +Indexes to my file. I added htaccess password protection so that not everyone could get to the files and that is now throwing the 404 error. Anyone else come across this problem before?

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Worked like a charm. Thank you!

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Thanks. Works great.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Well I am glad that I am not crazy.

    Thread Starter lelandmcfarland

    (@lelandmcfarland)

    Alright I figured it out but just in case anyone needs this in the future I forgot to change the variables in wp_blogs.

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