Forum Replies Created

Viewing 15 replies - 46 through 60 (of 73 total)
  • Thread Starter frikafrax

    (@frikafrax)

    No sarcasm.

    My apologies. It can sometimes be hard to gauge the intended tone in a text-only medium.

    I only don’t like questions like “do you realy want…

    That’s completely understandable. But “confirmation nagging” isn’t really an issue with a function like reset stats. It’s typically very rarely used, but it still requires a safeguard.

    My Way first read, than click. ??

    Well, humans are fallible creatures. ALL of us make mistakes from time to time.

    Accidentally resetting the stats on my blog actually did some good. The line graphs had been completely corrupted. Resetting the stats fixed the issue.

    But i also wrote i will include a verification. Checkbox or Popup.

    Thanks.

    Thread Starter frikafrax

    (@frikafrax)

    The red words are not warning enough?

    You obviously thought that accidental plugin removal was a potential user error issue because Count Per Day’s Uninstall function has a check box verification safeguard.

    So why does suggesting a safeguard for the reset stats function, which is also a valid potential accidental user error issue, now warrant a sarcastic reply?

    Thread Starter frikafrax

    (@frikafrax)

    Actually, using phpMyAdmin was my first consideration, but since I’m a total MySQL noob, I didn’t want to risk messing up the database. ??

    Time to invest in a MySQL book for dummies I guess. ??

    Thread Starter frikafrax

    (@frikafrax)

    Yes, I was able to reset access by creating a temporary Admin level account that used the erroneous user name I had entered for SlimStats, and made the appropriate corrections before deleting the temporary admin account.

    Thread Starter frikafrax

    (@frikafrax)

    Super!

    Thanks for all your hard work. It’s very much appreciated!

    I’ve got the opposite problem: a sudden drop in what had been an otherwise very consistent traffic pattern.

    Coincidentally, my sudden drop in traffic happened on Feb. 14th, the same day your site received its spike.

    My AWstats page doesn’t corroborate WP.com Stats’ traffic figures either.

    At present, WP.com Stats continues to report virtually no traffic on the blog in which it’s installed while AWstats reports the opposite.

    @electrolund

    I already posted that same link; see fourth post from the top. He already tried the method as outlined in Mark’s blog but it didn’t work in his case.

    The thread subject asks for a “universal” solution to adding post thumbnails and Mark’s method is usually how it’s done AFAIK. But the theme Foreclosurefraudnews was using did things a little differently and so it needed a different solution that worked within the theme’s established framework.

    This post should be ignored entirely as I was working with the wrong theme installed.

    This was the solution for the specific theme being discussed; adding a single, short line of code.

    You’re welcome. ??

    I forgot to mention that custom theme functions are defined in the file called “functions.php” that’s stored in the theme’s installation directory.

    If a theme author has used any custom functions instead of the standard internal WordPress functions, they should all be defined in that file, and you can figure out exactly what a custom function does by looking at how its defined in “functions.php”

    Hindsight: If I had gone to functions.php in the first place, I could have found out which custom function was responsible for loading thumbnails and then looked for it in the template files.

    No problem! It was a good learning experience for me.

    So to sum it all up…

    I checked the theme template file responsible for generating the blog’s front page. This is “index.php” that’s stored in the theme’s installation directory. In our case, it’s /wp-content/themes/gamezone

    The standard way to load a post thumbnail in WordPress is to use the function called the_post_thumbnail(). Normally this is what you’d look out for in other themes. But Gamezone didn’t have it. Weird…

    Since the thumbnails were being displayed next to excerpts, I looked for the WordPress function to show excerpts in “index.php”. The function to show excerpts is (unsurprisingly) called the_excerpt().

    I see the_excerpt() function in “index.php” and notice an unfamiliar function just above it called gz_home_image().

    That must be it. I copy it to the template file that’s used to show single posts (“index.php”) and it worked!

    The tricky thing here is the fact that the Gamezone theme author defined and used a custom function to load post thumbnails, so you’re not going to find gzo_home_image in any other theme except the Gamezone theme.

    Generally speaking, you should be looking for the_post_thumbnail() if you’re editing the placement or appearance of post thumbnails.

    You need to edit the file called “single.php”. This is the template file that’s used when you’re only displaying a single, specific post.

    Around line 25, look for the following code:

    <div class="postcover">
    
    <?php the_content('Read the rest of this entry ?'); ?>

    You have to insert code between those two lines:

    <?php gzo_home_image(); ?>

    The code should now look like this:

    <div class="postcover">
    
    <?php gzo_home_image(); ?>
    
    <?php the_content('Read the rest of this entry ?'); ?>

    Your post thumbnail images should now show up in single post display mode.

    That’s why I feel so stupid right now. X-D

    I actually used the link in your post to visit the GameZone theme site but I can’t explain how I ended up with GamezIne installed. ??

    What were you looking to do with the Gamezone (with an “O” ;-D) theme?

    Whoa, stop the presses… I think I might have screwed up.

    I may have confused the themes. I have one called Gamezone and Gamezine.

    Aw, crap! Lemme get back to you. ??

    EDIT: Oh man, I am SO embarrassed. I spent all that time fixing a theme called GameZINE so featured images would work with it. You needed help with Game ZONE.

    Argh!

    @foreclosurefraudnews

    I managed to get Gamezone to use WordPress’ post thumbnails feature.

    I’d rather defer to someone who really knows PHP but I’ll post my findings anyway in case you want to play around with it yourself.

    This example involves Gamezone’s index.php file.

    Gamezone loads thumbnails via URLs that are set by the blogger using Custom Fields and assigns the thumbnail URL to a variable called $screen:

    <?php $screen = get_post_meta($post->ID,'screen', true); ?>

    It then embeds that URL inside an img HTML tag:

    <img src="<?php echo ($screen); ?>" width="80" height="55" alt="" />

    After some Google-fu and checking out some entries in the WordPress Codex, I replaced this:

    <?php $screen = get_post_meta($post->ID,'screen', true); ?>

    With this:

    <?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,’thumbnail’, true); ?>

    What it does is fetch the ID of the thumbnail that’s attached to the post and assigns it to $image_id to be used later as a required parameter.

    Then it gets the URL of the actual post thumbnail using wp_get_attachment_image_src and assigns it to $image_url. Note that wp_get_attachment_image_src requires an ID, which is provided by $image_id that we assigned earlier.

    Then I replaced this:

    <img src="<?php echo ($screen); ?>" width="80" height="55" alt="" />

    With this:

    <img src="<?php echo $image_url[0]; ?>" width="80" height="55" alt="" />

    They do the same thing (I.e. Embed the URL of the thumbnail inside of the IMG HTML tag using php echo.) except that the replacement code uses the URL derived from wp_get_attachment_image_src.

    I installed Gamezine on a defunct blog that was updated to WP v3.0.4, added a few featured images to some random posts, tested the new code and it worked. Gamezone theme was using post thumbnails set within WordPress.

    I noticed that the Featured Posts slider would not function properly under Firefox, Chrome or Safari. Since I hadn’t made any changes to the glide.php script that controls it, this could be a theme issue.

    Since I don’t know PHP, that’s about as far as I go. As mentioned, I defer to those with PHP experience. I thought I’d take a crack at it anyway for what it’s worth.

    (BTW, I don’t know PHP myself but gleaned enough information to get post thumbnails working in a theme that didn’t support the feature.)

    In a nutshell, The Loop isn’t a stand alone PHP script per se. It’s a section of code that WordPress uses to format and display posts and it’s called repeatedly in a loop while there are posts left to be displayed.

    Typically, this section of code is located in the “index.php” file of your current theme as well as any other template file that’s used to display a post to the user.

    This link in the WordPress Codex explains the Loop in action.

    Oh, and having pages indexed that have some technical relevancy to your site (like your log-in page, or your site policy pages etc.) but have no “search engine value” is not considered a negative thing by Google.

    It doesn’t do your site any harm. But I understand why people prefer that they not show up in the SERP.

    That’s my preference too. I use robots.txt to stop Google from indexing any page/link on my blogs that serve a purely technical purpose and don’t have any search engine value with regards to relevant content.

Viewing 15 replies - 46 through 60 (of 73 total)