marktastic
Forum Replies Created
-
Forum: Plugins
In reply to: image above title of post// This statement checks to see if img_post_header exists and then if it does, write the img tag:
<?php
if(get_post_meta($post->ID, 'img_post_header', true))
{ ?>
// We jump out of php to show the img tag. If you wanted you could do a print function instead, but this is how I did it.// I added an example of a specified alt text (the key was img_post_header_alt). If you want to do width and height make keys for them and add them the same way (make new keys). I would think it would be more ideal to have the width/height constant, but if it’s what you need then go for it:
<img src="<?php echo get_post_meta($post->ID, 'img_post_header', true);?>" width="600" height="200" alt="<?php echo get_post_meta($post->ID, 'img_post_header_alt', true); ?>" />
// This closes the if statement
<?php } ?>
Hope it helps!
-MarkForum: Fixing WordPress
In reply to: starting to lose hopeThis might not be the solution you were hoping for, but if all else fails and you are desperate, maybe you could try something like the following:
1) Back up all of your installs (directories and databases)
2) Reinstall fresh copies (however many you need) all to one db keeping in mind the different prefixes you need to make.
3) Copy each individual backup and paste them into their newly installed folder overwriting everything.
4) Transfer the old db info into the new relevant tables.
Again this is probably a last ditch effort and you should wait for someone else to make a more intelligent response.
Forum: Developing with WordPress
In reply to: Add photo before Title?Good question. I think the most obvious answer is to write an IF statement to check if the img_post_header key exists, and if so then print out the img tag.
I’m to lazy/tired to write out any code atm, but if you need it just reply.
Forum: Developing with WordPress
In reply to: Add photo before Title?I posted this in another topic, but I’d thought I post it here too. Took me a short while to come up with but maybe it’ll help you.
To get an image above the title using custom fields and no plugins do the following:
1- Make a post in wordpress
2- Under custom fields create a key titled “img_post_header” or something similar
3- For the value, insert the location of the image
4- If you want more image atributes (such as alt text), make more keys and remember what they are called
5- Save/publish that stuff
6- Open /wp-content/themes/[themename]/index.php, after the <div class=”post”> but before the <h2> title (should be around line 9), add this line:
<img src=”<?php echo get_post_meta($post->ID, ‘img_post_header’, true);?>” width=”600″ height=”200″ />Of course edit width and height to your specifications.
7- For a custom alt attribute, edit the line to add something like this (assuming img_post_header_alt is the key you used in #4):
alt=”<?php echo get_post_meta($post->ID, ‘img_post_header_alt’, true);?>”If say you wanted to make the post title the alt text do this:
alt=”<?php the_title(); ?>” inside the img tagYou should be all good after this.
Not quite sure I understand, but can you just escape the quote like this: \”
Forum: Fixing WordPress
In reply to: Look for cookies?Your problem was solved, that’s what counts :p
Forum: Plugins
In reply to: image above title of postHere is how to do it without a plugin:
1- Start a post in wordpress
2- Under custom fields create a key titled “img_post_header” or something similar
3- For the value, insert the location of the image
4- If you want more image atributes (such as alt text), make more keys and remember what they are called
5- Save/publish that stuff
6- Open /wp-content/themes/[themename]/index.php, after the <div class=”post”> but before the <h2> title (should be around line 9), add this line:
<img src=”<?php echo get_post_meta($post->ID, ‘img_post_header’, true);?>” width=”600″ height=”200″ />
Of course edit width and height to your specifications. If say you wanted to make the post title the alt text add: alt=”<?php the_title(); ?>” inside the img tag
It took me some time to come up with this, and I hope it helps someone out there.
Forum: Fixing WordPress
In reply to: Look for cookies?The thing about cookies is that they are written to your hard drive and don’t need to be passed around websites to be kept alive.
It sounds like the problem lies somewhere within the shopping cart. Maybe it resets the cookies every time an unregistered/unlogged in customer visits the site. Do you have it check for an existing unregistered persons cookie before setting it?