wpismypuppet
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Redirect page and show popup messageWell, first off you have the first piece a little wrong… you’ll want it to be this:
<?php session_start(); $_SESSION['men'] = 'yes'; header( home_url('/') ); ?>For ease of use, let’s just set the ‘men’ variable to “yes”. Once you get it working, you should make it more secure so it’s not easily guessed.
Also, since you want to send people to the homepage of your WordPress site, we can send them using home_url(). Using this function will allow it to work even if you changed the domain name to something different down the road.
Your version redirects them back to the /men page, which will cause a continuous loop to happen. Also, because you are using the header() function, you do not need any 301 redirects. That is the point of using this method.
On the homepage, you have the code correct, but we’ll change the variable to reflect:
<?php session_start(); if( isset( $_SESSION['men'] ) ) { if( $_SESSION['men'] == 'yes' ) { // Do something here } } ?>As far as the pop up code, you implement something as simple as a JavaScript modal. jQuery is already being used by WordPress as a default, so you could easily use a jQuery modal of some kind. There are literally thousands of scripts out there… just have to find the one that does something similar to what you are looking for. How much programming experience do you have?
Forum: Fixing WordPress
In reply to: Redirect page and show popup messageAn example with a variable in the URL… on the /men page:
<?php header( "Location: somepage.php?myvariable=" . urlencode( "variable value" ) ); ?>and when you get to the page doing the pop up:
<?php if( isset( $_GET['myvariable'] ) ) { if( $_GET['myvariable'] == 'variable value' ) { // Do something here } } ?>It’s good to check the actual value of the variable to make sure no one tampered with it. Make the value weird and unique so it can’t easily be guessed. Also, you can make it random for each time so it can never be guessed… similar to using a nonce. Depending on the situation, a nonce may even be the way to go.
To do the same thing without a variable in the URL, you’ll need to use a session. On the /men page:
<?php session_start(); $_SESSION['myvariable'] = "variable value"; header( "Location: somepage.php" ); ?>and when you get to the page doing the pop up:
<?php session_start(); if( isset( $_SESSION['myvariable'] ) ) { if( $_SESSION['myvariable'] == 'variable value' ) { // Do something here } } ?>Forum: Fixing WordPress
In reply to: I can't get css float to work!In your style.css file, on line 444 you have this rule set up:
h1,h2,h3,h4,h5,h6 { clear: both; }Since “Introduction” on that page is an h2, it’s clearing the float right. Change that rule, or remove it completely and your problem is fixed.
Forum: Fixing WordPress
In reply to: Update problems and Storage issuesSounds to me like a similar problem I ran into a while back. Someone asked me the same type of problem (same errors and everything) and when I looked further into it, they ran out of space on their server. Basically they were given a certain quota, not sure exactly how much, but they uploaded enough content to reach their quota and therefor couldn’t upload anything else…
Sounds to me like you were close to your quota… then you upgraded WordPress and the additional file sizes and possibly additional files that came with the upgrade, and the additional five more pics you uploaded, pushed you over your quota.
Call your web hosting company to confirm, and buy more space if needed. This is just a guess, of course, as I don’t have access to your site or FTP info or anything like that. But pretty sure it’s spot on 🙂
Forum: Fixing WordPress
In reply to: Cycle Through Next/Prev Posts Possible?Here is a quick plugin I found… haven’t testing it, but it looks to do what you requested. There should be plenty more if this one fails.
http://wordpress.org/plugins/loop-post-navigation-links/
Here’s another:
http://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/
Or you could try to code it out yourself:
http://wordpress.org/support/topic/how-to-show-first-post-link-in-last-post-in-pagination
Forum: Fixing WordPress
In reply to: Menu is broken in IE, please help!It is just a css problem. Use conditional comments to target IE 9 and possibly 10 since these are the only two you are seeing the issue in. Set a 100% width to
#nav ul(IE likes to have widths for almost everything), and play with the left/right padding for#nav a.On a side note, you should also try to remove those “gaps” between each drop down element as in IE7-8 it makes the menu close if the mouse happens to come in contact with a gap, which is very often 🙂
IE tends to handle padding differently than all other browsers… you may also find you have a problem in Safari for MAC, as MAC uses different techniques for anti-alias and smoothing of fonts, which generally make them “larger”, which generally causes wrapping to occur.
On another side note, if something breaks when you launch IE’s developer tools, don’t use that as an idea that something is terribly wrong in your website’s code. Though in your case the code is really bad (through no fault of your own), the developer tools for IE are HORRIBLE and would probably break even the most valid of websites when launched. 🙂
Forum: Fixing WordPress
In reply to: Images not loading sometimesBefore I go as far as disabling plugins and switching to the default theme, I would first start by trying a new browser… maybe Firefox or something. See if the problem persists in any other browser. The reason I mention this is you stated:
The only workaround I could find was to quit Safari and restart it; then graphics would appear on that one but not on the next. Now it only happens about once a day, and restarting the browser fixes it.
If simply closing the browser fixes your issue, then it sounds more like a browser issue than a WordPress issue. WordPress would still be broken when you launched the browser again. It is possible that a plugin could be causing the issue and that restarting the browser also resets the plugin, but that’s weird to me.
If the problem persists in a different browser, try WPyogi’s suggestion…
Forum: Fixing WordPress
In reply to: Add search box in footerYou simply add a style!
#searchform { width: 88%; } #searchform div { background: #ffffff; }The first style keeps the form from hitting the right edge, and the second one adds a background color of white. There is already a style in place that makes the width 99% (line 1117 in style.css), so you should really find that and alter it instead of creating a new one.
Forum: Fixing WordPress
In reply to: Gallery Loading without ColumnsThere should be a columns attribute in that shortcode. Though I don’t know why selecting 3 columns didn’t insert the code, you can do it manually by changing your shortcode to this:
[gallery ids="2283,2282,2267,2265,2266,2263,2264,2284,2285" columns="4"]Forum: Fixing WordPress
In reply to: create a single author pagehttp://codex.wordpress.org/Author_Templates pretty much sums it up. And although it DOES just archived posts that the author has written, you can customize the page to show just about anything you’d like.
Scroll down the link to the section labeled “Custom Author Information” and you’ll see how to add things like name, bio, contact info, etc.
Forum: Fixing WordPress
In reply to: move wordpressActually “Search and Replace” offered by vtxyzzy is ridiculously easy and we use it on almost a daily basis when we move a testing environment over to production.
You download the file from the website, upload it to the root folder using any FTP program, and access it by typing http://www.domain.com/searchreplacedb2.php (of course replace domain.com with your actual domain). Then you follow the wizard, which is basically click, click, click then type in the string you want to find and the string you want to replace.
WP-CLI requires a Linux environment… what if the user has a Windows one? I know… I shudder just thinking about that myself… but it’s possible!
At any rate, I wrote up a whole instructional on “How to migrate a WordPress installation to another domain“. It’s a bit lengthy, but that’s only because of the detailed instructions so people know what’s going on behind the scenes. If you look at the core of what’s happening, it’s really basic and super easy.
Forum: Fixing WordPress
In reply to: Redirect page and show popup messageYou can’t easily detect 301 redirects… at least it won’t be 100% all of the time. There is an array in PHP called $_SERVER which has an entry called $_SERVER[‘HTTP_REFERER’] which attempts to store the address of the previous page through the user of the user agent string. User agent strings are easily manipulated and can’t be trusted, if they even work at all!
If you have a page, that you control, that is doing the redirect… why not use PHP to do the redirect itself and pass a variable in the URL that can be detected on page load? If the variable is in the URL, show the pop up. You could even pass the variable hidden so it doesn’t clutter the URL up. This is fool proof as the variable would only exist if the user came from the page doing the redirecting!
I can offer some examples of code, but I’d need to know your setup to offer significant advice. For example, what group of people are being redirected? How do you determine who is in that group? What happens to those not in that group? Do they stay on the page, or are they redirected elsewhere? And so forth…
Forum: Fixing WordPress
In reply to: Don't show a widget if browser is a mobile browser?First off, let me start by staying that this advice is not “responsible web programming”. Simply “hiding” elements from mobile devices still causes the mobile devices to download the content, even if you don’t “see” it on the screen. For people with unlimited data plans it may not be that big of a deal. But almost every country charge mobile users by the megabit, and downloading content that they’ll never see eats up their data plans (and their wallets) for no reason.
We who code the web should start taking this type of practice more serious. I HIGHLY recommend reading up on articles from people like Luke Wroblewski, Myers, and all the other popular web gurus out there on “Mobile First” and “Responsible Web”. Do a Google search and you’ll see lots of information out there.
And secondly, it all depends on how sensitive the data is we are trying to hide from mobile devices. If it’s really sensitive data, display:none will not protect you. Screen readers and other accessibility programs will quickly pick up on hidden elements. My guess is the data isn’t that sensitive if it’s being displayed on non-mobile devices, but still we must consider this as well and never assume. We all know what that leads to…
And third, unknowing of why the OP wants to hide data from mobile devices, I must also stress that it is bad practice to have your mobile version contain less data or elements than it’s “full version” counter part. Why hide data??? More and more people are using their mobile devices strictly for web browsing and not using laptops or desktops. Websites that we create are content driven… it shouldn’t matter what device the website is being viewed on, you should serve the same content. The only difference is how we arrange that content, but we don’t even have much control over that anymore. In fact, we’ve never had control over that… it’s always been just an illusion. But that’s another thread altogether.
Forum: Fixing WordPress
In reply to: How to crop thumbnails?This might help, might not… but it’s a plugin we use all the time on our sites. It gives you the ability to choose the focal point on the image when it gets “crunched” into the different file sizes.
http://wordpress.org/plugins/imagefocuspoint/
Basically you upload your image, then find it in the media library, and then edit it. You can use your mouse to click anywhere on the image where you’d like it to crop from. By default WordPress uses the center of the image and crops top/bottom/left/right off the image to make it’s thumbnails. If text is getting cropped, set the focus point to the text and it should remain in the newly cropped thumbnails.
This doesn’t always fix the issue and sometime you need to make a properly sized image before you upload it to WordPress, but this does help a lot of the time.
Forum: Fixing WordPress
In reply to: Custom URL for my WordPress WebsiteSorry, I wasn’t trying to solicit, I was trying to insult the company this poor person hired claiming they couldn’t do something so easy. My point was to say that a company who is paid to create WordPress websites should know basic redirects and be willing to spend 10 minutes researching the solution… especially since this person paid for this assistance.
I’ll keep my insults to myself 🙂