Forum Replies Created

Viewing 15 replies - 1 through 15 (of 24 total)
  • Thread Starter frankjackson

    (@frankjackson)

    irelectron

    Nothing. I gave up. Maddening. The other thing is, nobody seems to want to talk about it either… it’s really weird. I even talked to my hosting company and got nowhere. Sorry mate.

    Thread Starter frankjackson

    (@frankjackson)

    Thank you for leaving it. The reason it MAY be a wordpress problem is because I’m wondering (and asking) if I have the htaccess in the proper wordpress directory. I don’t think it’s a problem with the code inside the htaccess file, I think it’s a matter of where I’m putting that file within wordpress… granted, I could be totally wrong about that, which is what I’m trying to determine here.

    RE: If you Google, “htaccess” you will find a lot of information and perhaps your answer.

    Trust me, I’ve googled that a thousand times this week, I’ve made boatloads of alterations to the file, but nothing has changed… which is exactly why I’m here… all that made me suspect that maybe (as expressed above) it’s an issue with where I’m putting the file within wordpress.

    Thanks alot for leaving this up though… I appreciate that.

    Thread Starter frankjackson

    (@frankjackson)

    Howdy sir, sorry but I have no idea what you’re trying to ask me. Yes, this is happening on a wordpress site? Are you suggesting maybe this isn’t a wordpress related problem and shouldn’t be here in this forum? If so, you may be totally correct… the problem is, I have no idea… is it a wordpress issue? Maybe it is, maybe it isn’t… I have no idea?

    Thread Starter frankjackson

    (@frankjackson)

    So now I just checked my site at a few other checker sites (google speed, etc) just so that I wasn’t basing all this on one sites eval (pindom). BUT alas I get the same result at all checjer sites (ie, please set a Vary: Accept-Encoding & set a longer freshness lifetime… as described at length above). Mind exploding!

    Thread Starter frankjackson

    (@frankjackson)

    I saw that. Didn’t realize it was something new, just thought my pseudo-‘coding’ was a giant mess as normal (normally a cobbled mix of modified scraps of snippits copied and pasted from elsewere).

    I’ll definitely change it now though thanx.

    BTW, while I’ve got your attn: (if not trying to monopolize your good deeds), do you know anything about htaccess??? >>> 🙂

    https://ww.wp.xz.cn/support/topic/htaccess-vary-accept-encoding-not-being-found-by-toolspingdomcom?replies=3#post-6446615

    Thanks in advance if…

    [+]

    Thread Starter frankjackson

    (@frankjackson)

    EDIT:

    Ignore my “update” above, it’s back to neither of them working. So effin’ confused by this, seems simple enough… those htaccess tweaks I put in are all over the web exactly as I have them, yet mine isn’t being recognized (or something I guess).

    I feel like the answer is that I need to put that htaccess in some other directory, but for the life of me I have no idea where??? …ahghgh%^%^%U67!@!!

    Thread Starter frankjackson

    (@frankjackson)

    Funny… thanx again man!

    Thread Starter frankjackson

    (@frankjackson)

    Thanks, I’ll try that brother, although it already fixed itself somehow after a couple of days. I guess maybe it was some weird caching thing I guess??? I’ll try your code though just to clean up my mess anyway.

    Thank you sir.

    I don’t think I should mark it solved yet though because I still have no idea what the hell was actually happening. Was it a caching issue??? I don’t know.

    Thread Starter frankjackson

    (@frankjackson)

    Wow awesome… literally 10 second fix.

    I didn’t need to get rid of the else statement because after fixing this part as you pointed out.

    $image_relative_path = “/” . $tag->slug .”.jpg”;

    … instead of out-putting the default image, it output the tag name (the alt) linked to the tag page. At that point I knew it was close so I checked the source code of the page and saw a garbled mess in the img src=””.

    I knew the problem immediately (you probably noticed earlier):

    I had img src=”$image_path” … instead of img src=”$image_url” (easy spot/easy fix)…

    Fired it up, and yahooooooooooo!!!

    Works perfectly.

    This will save a ton of work. I was using a plugin where I had to manually upload and assign an image to each new tag individually.

    Now instead, I can just batch ftp a bunch of images into the uploads folder (named the same as their respective tag slugs [ tag-slug = tag-slug.jpg ]) and this thing will grab/associate the photos to the tags for me automatically.

    Thanks again brother, that was a real quick fix once you pointed out the $image_relative_path = “/” . $tag->slug .”.jpg”; mistake (and sending me that link earlier).

    This is the final WORKING code (all that’s left is to clean it up a little as you’ve pointed out). I’ll save that for tomorrow (it’s 4:15am here, I was on my way to bed and heard your email come in, and checked it, and had to give it a try… happy I did :)!

    Final WORKING code:

    <div class="image_wrap">
    <?php
    $posttags = get_the_tags(); // Get articles tags
    $home = get_bloginfo('url'); // Get homepage URL
    
    // Check if tag-slug.jpg exists and display it.
    if ($posttags) {
     foreach($posttags as $tag) {
    		$upload_dir = wp_upload_dir();
    		$image_relative_path = "/" . $tag->slug .".jpg";
    		$image_path = $upload_dir['basedir'] . $image_relative_path;
    		$image_url = $upload_dir['baseurl'] . $image_relative_path;
    
    		if (file_exists($image_path)) {
    		echo '<a href="' . $home . '/' . $tag->slug . '" /><img title="' . $tag->name . '" alt="' . $tag->name . '" src="' . $image_url . '" /></a>';
    
           // If no image found, output something else.
           } else { ?>
             <img src="<?php bloginfo('template_directory'); ?>/img/default-author.jpg" title="  image missing  " />
           <?php }
      }
    }
    ?>
    </div><!-- #image_wrap -->
    Thread Starter frankjackson

    (@frankjackson)

    Thank you sir. Based on your advice, I ended up with this. It’s just one of several variations that I can’t get to work.

    I’m certain you’re on the right path (pun) but I guess I just don’t know exactly how to write it all out properly.

    This is the last one I tried. Any obvious mistakes???

    <div class="image_wrap">
    <?php
    $posttags = get_the_tags(); // Get articles tags
    $home = get_bloginfo('url'); // Get homepage URL
    
    // Check if tag-slug.jpg exists and display it.
    if ($posttags) {
     foreach($posttags as $tag) {
    		$upload_dir = wp_upload_dir();
    		$image_relative_path = "/" . $tag->slug.jpg . "";
    		$image_path = $upload_dir['basedir'] . $image_relative_path;
    		$image_url = $upload_dir['baseurl'] . $image_relative_path;
    
    		if (file_exists($image_path)) {
    		echo '<a href="' . $home . '/' . $tag->slug . '" /><img title="' . $tag->name . '" alt="' . $tag->name . '" src="' . $image_path . '" /></a>';
    
           // If no image found, output something else.
           } else { ?>
             <img src="<?php bloginfo('template_directory'); ?>/img/default-author.jpg" title="  image missing  " />
           <?php }
      }
    }
    ?>
    </div><!-- #image_wrap -->

    [+]

    Thread Starter frankjackson

    (@frankjackson)

    UPDATE:

    Okay so #2 above (mod_expires.c) is now working, but this part is still not working…

    # Specify a Vary: Accept-Encoding header
    <IfModule mod_headers.c>
      <FilesMatch ".(js|css|xml|gz)$">
        Header append Vary: Accept-Encoding
      </FilesMatch>
    </IfModule>

    Anyone see anything wrong with that code, … or any other ideas why that’s not being “found” (I guess?)

    [+]

    Thread Starter frankjackson

    (@frankjackson)

    I found a good solution for anyone else looking to do something like this:

    My final code above, and then the scripts on this page http://www.javascripttoolbox.com/lib/popup/example.php to trigger the popup.

    +

    @andersbalari I love you man. That was awesome. 10 seconds to paste in, and works perfectly. So happy w/ this. Thanks for sharing man.

    Thread Starter frankjackson

    (@frankjackson)

    No change here, still no breaks.

    Thread Starter frankjackson

    (@frankjackson)

    @bompus

    I switched the theme and everything works as it should so it may be a very isolated thing (ie, not your problem) thanks though.

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