Forum Replies Created

Viewing 15 replies - 31 through 45 (of 50 total)
  • You stated “I must use a base in each and every permalink.” This is a .htaccess file issue with mod_rewrite, most likely caused by your host. Double verify your .htaccess file looks exactly like this.

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

    If it doesn’t or is not being generated it may be an issue with your hosts server settings and you can refer to https://codex.www.ads-software.com/Using_Permalinks#Fixing_.htaccess_Generation_Issues

    You can also try to put a trailing slash onto the end of your permalink so it looks exactly like /%postname%/

    But based upon you saying “I must use a base in each and every permalink.” I can almost say for certain its a mod_rewrite issue in your .htaccess file or your host is doing something funny with there Apache settings.

    If it is printing out only one zero then there is only one image in the loop to go through, if it is printing out more then one zero then try using a for loop instead and see what happens.

    Example:

    for( $i=0; $i < count( $images ); $i++ ) {
      echo '<div id="photosWrapper"><div id="photos"><img src=' . $images[$i] . '.jpg rel="shadowbox" border="0" class="a"/></div></div>';
    }
    $counter = 0;
    foreach($images as $image) {
    echo '<div id="photosWrapper">' . '<div id="photos">' . "\n" . '<a href="' . the_permalink() . '<img src='.$image.'.jpg rel="shadowbox" border="0" class="a"/></div></div>';
    
    $counter++;
    
    if( $counter >= 3 ) {
    // do something here
    $counter = 0; // reset your counter
    }
    }

    A programming tip: Use less echo’s, the example I used above concatenates the strings but instead of using the dot you can use a comma or use “here document” syntax.

    Eg:

    echo <<<END
    This uses the "here document" syntax to output
    multiple lines with $variable interpolation. Note
    that the here document terminator must appear on a
    line with just a semicolon. no extra whitespace!
    END;

    You probably already done step one but verify that your permalink custom field reads /%postname%/

    My second thought if your using certain hosting providers (I.E. GoDaddy) and this is a new site, or one that has never used the .htaccess before it can take up to 1 hour for the changes to reflect on your site.

    I know that sounds strange but here is the source – https://help.godaddy.com/article/1082?locale=en it states “Changes made to an existing .htaccess file will be seen immediately. When creating new .htaccess files or deleting existing .htaccess files, you might not see changes for up to an hour.”

    I’ve found that issue to sometimes occur but most of the time it doesn’t, its quite strange to me but that may be what’s happening if you run other sites that work with those settings and this is a new one that doesn’t.

    <?php if (strtotime($post->post_date) > strtotime('-4 days')): ?> <b>NEW</b> <?php endif; ?>

    Taken from https://www.ads-software.com/support/topic/if-statement-comparing-post-date-to-todays-date?replies=4

    PHPs strtotime function parses just about any English textual datetime description into a Unix time-stamp that can then be compared, so today’s date would be something like 1234 and yesterdays date is 1233 so you can use the code above to do your comparisons.

    More Info: https://php.net/manual/en/function.strtotime.php

    Yeah if your using GoDaddy you have to login to your account, click the hosting tab, login to your hosting account, then once there click the database tab, then select the database, then click the edit database, enter in your username/password, and you’ll see the tables, ect…

    Forum: Fixing WordPress
    In reply to: Side bar

    $tmp = $page->ID;

    There is a global $page variable that you can use!

    Open up your PhpMyAdmin panel select your database, select the options table and for option_id 1 change the option_value to https://billblackmonphotography.net, do the same for option_id 37 save those changes.

    Now go back and login to your admin panel then go to Settings and make sure the WordPress Address and Site Address both read https://billblackmonphotography.net if not change those values to https://billblackmonphotography.net

    Now even if they read correctly click the Save Changes button and everything will be back to normal.

    Try changing this line in your CSS

    .entry .post .content { padding: 12px 38px 15px 45px; }

    To this

    .entry .post .content { padding: 12px 38px 15px 45px; background-color:#fff; }

    Fixed the issue, the hackers just changed there themes index.php file, definitely looks like a security issue with your hosting provider.

    I just ran some tests on my development environment and production environment to see if I could re-produce your problem, but I’m faced with a different bug on my installs via – https://core.trac.www.ads-software.com/ticket/17764

    I can’t say with 100% accuracy but its most likely an issue with the TinyMCE editor not accepting the Javascript width’s set on your media settings page (Possible bug).

    Oops forgot to mention that will also mess up your pages with your sidebar, in your custom post page, change the html that looks like this

    <div class="entry text">

    to this

    <div class="entry text widemode">

    Then add this to your style.css file

    .widemode{ width: 960px; margin-bottom: 35px; position: relative; }

    In your style.css file try changing this line of code

    .entry { width: 490px; margin-bottom: 35px; position: relative; }

    to this line of code

    .entry { width: 960px; margin-bottom: 35px; position: relative; }

    Forum: Fixing WordPress
    In reply to: Editing PHP

    For your first issue: “does that first semi-looking post w/ the picture & read more: how do I make that so my first post shows up there?”

    That is going to be theme specific, if your theme doesn’t support it, you’ll have to edit your index.php file and program the first post in the loop to be displayed as such (Sorry its impossible to give you code references, without seeing any source code).

    As for moving your twitter plugin, if its a widget you can go into your admin panel and under Appearances->Widgets and see if there is another place you can move that widget to.

    Otherwise you’ll have to open up your index.php and sidebar.php files and play with them until you get things working the way you want them.

    They most likely didn’t hack your WordPress install I’ve seen these boys before they hack Shared Hosting Accounts I.E. Your Tucows provider and they place a HTML, or PHP file in your directory that takes precedence over your other files.

    You can search it out and attempt to find and delete that file, if that’s the case run hard and fast away from Tucows hosting.

    Now if they hacked your WP install it’s most likely an SQL injection because of a badly developed plugin, so you’ll have to search through your database looking for the Javascript code thats being executed.

    Update: I just did a quick test, I don’t think its an SQL inject its most likely they hacked your hosting provider and inserted the HTML file, that is these guys M.O.

    So now the question is how to fix it, well I’ve gave you an overview of how to fix it but you said your extremely new to all of this so I’m a kind person and if you want you can email me at [email protected] with your hosting account login details, or setup a temp user/pass on your hosting account and let me access the database and file folders of your WP install so I can go over and see if I can fix it for you but you may not want to do that for security reasons considering you just got hacked, its hard to trust someone, especially when I ask for such important information like access to your files.

    But the choice is yours, you can try to search what I posted above or take the risk and I’ll be happy to go through and have a look for you.

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