jtyarks
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WP generates a thumbnail, how do I display it?I’m afraid I don’t have a better answer for you – the aforementioned code
<?php $image = wp_get_attachment_image_src(get_field('your_image_field_name'), 'thumbnail'); ?> <img src="<?php echo $image[0]; ?>" alt="" />converts your image to the thumbnail size quickly and ensures you won’t have to worry about the original image.
Also, should you ever want to change the size, you can make ‘thumbnail’ anything you want – WordPress defaults (‘medium,’ ‘full’) or your own custom size/crop using set_post_thumbnail_size (http://codex.ww.wp.xz.cn/Function_Reference/set_post_thumbnail_size).
Forum: Fixing WordPress
In reply to: WP generates a thumbnail, how do I display it?The code needs to return the ID in order to do any type of resizing and the file name may change depending on your media settings (uploading to a month/year directory or not).
Given that WordPress’ “Thumbnail” size defaults to 150×150, this code should return your image exactly how it appears in the back-end when uploading through ACF:
<?php $image = wp_get_attachment_image_src(get_field('your_image_field_name'), 'thumbnail'); ?> <img src="<?php echo $image[0]; ?>" alt="" />(See http://www.advancedcustomfields.com/docs/field-types/image/ for more info.)
Forum: Fixing WordPress
In reply to: WP generates a thumbnail, how do I display it?The plugin, Advanced Custom Fields?
If that’s the case, you simply need to add the field to your template.
Example:
<img src="<?php the_field('your_image_field_name'); ?>" alt="" />I believe, if you want to get the thumbnail version, you’ll need to do two things:
1. In your custom field, select “Attachment ID” for the Return Value
2. In your template, do something like…<?php $image = wp_get_attachment_thumb_url(get_field('your_image_field_name')); ?> <img src="<?php echo $image[0]; ?>" alt="" />Sorry, forgot to mention I did try your first two suggestions and it didn’t change anything…BUT I found out it is due to a plugin conflict – something about “Profile Builder Pro” is messing with the query.
Not sure if these two can live in harmony, but I’ll be sure to post an update if I find a workaround.
Thank you for your help, vtxyzzy!
Forum: Fixing WordPress
In reply to: Duplicate Pages and Content?After selecting, it should ask you if you want to import the post attachments – make sure to click yes. If any don’t come through and you don’t have FTP access, you may have to add them manually.
As for the error, that seems like an issue with your host; I suggest you reach out to them to find out what’s going on.
Forum: Fixing WordPress
In reply to: WP generates a thumbnail, how do I display it?Are you using a Featured Image (http://codex.ww.wp.xz.cn/Post_Thumbnails), are you adding an image directly to a post, or are you uploading an image to the media library exclusively?
Using the post thumbnail (Featured Image) should be pretty straight forward – you need to modify your template with a call to the thumbnail:
if ( has_post_thumbnail() ) { the_post_thumbnail(); }That will generate the image tag for you and then you can style it using the classes added (or wrap it in another element, such as a div, and style that).
If you’re doing something else, just be a bit more specific and I’ll try to provide with steps.
Cheers.
Forum: Fixing WordPress
In reply to: Duplicate Pages and Content?Do you still have access to the old site? If so, log in, go to Tools > Export and click “Download Export File.”
This will give you an XML file with all pages and posts that you can then go to your new WordPress install, navigate to Tools > Import (requires the WordPress Importer plugin – http://ww.wp.xz.cn/extend/plugins/wordpress-importer/) and import the file you just downloaded.
Hmm; I just uploaded that code to a test site and didn’t get any problems. It could be conflicting with a few things.
What theme are you using? Can you send me an email with your functions file and I’ll test it out? ([email protected])
I’ll be at work for at one more hour, but will happily test it out for you after that.
Cheers.
Sorry, at work so I’m not able to test much right now. That said, this should definitely go in your functions.php file.
Try this –
add_action( 'init', 'jobman_rewrite' ); function jobman_rewrite() { global $wp_rewrite; flush_rewrite_rules(); }No worries – you should be able to place it anywhere and get the same result. Just for this test, add immediately after the opening “<?php”
After that’s in there and saved (either via WordPress’ editor or uploaded through FTP), refresh your jobs section and see if the plugin works properly. Again, regardless of whether it works properly or not, you’re going to want to remove those lines from the functions file after testing.
Hmm, that’s pretty odd.
Sorry, let me clarify about what I had to confirm it was working:
Before adding my own job solution to the mix, I already had a custom post type called “offers” for an Offer feature. I added that code I mentioned to my offer post type and saw that the plugin was then functioning properly.
When I decided to go with a custom solution, I made my own post type called “jobs,” and added the aforementioned code there instead. I thought that it was because of my own post types that the plugin wasn’t working. (I had tried adding the job manager to a different multisite on another host without any other post types added and got it working properly.)
As for the “too late” statement, I’m referring to the fact that the post types are not being registered in your functions file and I believe that code I gave you needs to be attached to the same call that registers the post type in the first place. That said, you should be able to do it just for one of the post types (‘jobman_job,’ ‘jobman_app,’ whatever) and it would affect all of them.
To confirm that you’re having the same problem I was, add this to your functions file:
add_action( 'init', 'flush_rewrite_rules' ); function flush_rewrite_rules() { global $wp_rewrite; $wp_rewrite->flush_rules(); }(Don’t keep this in here after you confirm whether or not it works – this uses up a lot of resources.)
If the plugin is working, then we are having the same issue and the developer should probably add a flush rules to the plugin. If not, then we have separate issues.
So, your jobs display fine only if you reload the permalink page? Also, just to confirm, you’ve set them back to default and then resaved as /%category%/%year%/%monthnum%/%postname%/?
As for the plugin itself, It actually creates several post types:
- jobman_job
- jobman_joblist
- jobman_app_form
- jobman_app
- jobman_register
- jobman_email
- jobman_interview
If resaving your permalinks (not just reloading the page) doesn’t work, I’m not sure if you can target the problem through your functions file (it may too late because the post type is already registered) or if you’ll need to edit the plugin itself.
If the fix can come through your functions file, you’d need to add something like this:
add_action('init', 'jobs_fix', 0); function jobs_fix() { $set = get_option('post_type_rules_flased_jobman_job'); if ($set !== true){ flush_rewrite_rules(false); update_option('post_type_rules_flased_jobman_job',true); } }If that doesn’t do it, then it sounds like the plugin needs a few extra pieces added to its code.
Let me know, I’ll happily submit a ticket to the developer’s issue list.
Also, a few things to try:
* Login with an adminstrator account
* Install and activate the plugin
* Visit your permalinks page before adding any jobs. You shouldn’t need to do anything – visiting with an admin account should flush the rewrite rules.
* Add a job.If that doesn’t work, try the same process but change your permalinks to default and then save them to your preferred pretty permalink set up.
If that still doesn’t work, you’re going to need to add in a function to rewrite the rules.
Hi wibbsy,
What’s your set up now? Do you have any custom post types aside from what Job Manager created? Are you only able to see the posts if you have default permalinks on? (The answer changes depending on those variables.)
To answer your last question, we went with an in-house solution because we wanted to reduce our plugin dependency given how the large project scope (an ever-growing multisite). I created a custom post type (‘jobs’) and used Gravity Forms (http://www.gravityforms.com/) to handle the application submission. (I’m sure you could do this with Contact Form 7 or something similar if you don’t want to purchase Gravity Forms.)
Cheers.
Apologies for the late update to this but, just in case anyone is having similar issues, I wanted to share what ended up solving the problem.
As I was sure of, this had nothing to do with the plugin, but my permalinks – I needed to flush the rewrite rules.
Knowing that
flush_rewrite_rulesis quite taxing, I searched around for a way to only call it upon activation.(Note: Unfortunately, the way WordPress’ Function Reference described didn’t seem to work for me.)
Luckily, I found Ohad Raz’s post and added the following lines to my C.P.T. function (‘jobs’ being my custom post type):
$set = get_option('post_type_rules_flased_jobs'); if ($set !== true){ flush_rewrite_rules(false); update_option('post_type_rules_flased_jobs',true); }…and all was well.
While I ended up not using the plugin, I did confirm that doing this did make the plugin function properly.
Hopefully this proves helpful to someone else!