xanderashwell
Forum Replies Created
-
I can’t test it at the moment, but is it a syntax error? Try dropping a space between the two periods in the third table cell like so:
. $term->description .
failing that, try
print_r($terms);
orprint_r($args);
to see exactly what information is within that array, that may shed some light on the issue.Hi Geet,
Try again, the zip file was corrupt at my end as well – I’ll also stick a copy up on github when I get a chance.
Elliot has a
register_field
function now which is great for extending ACF:
Creating and registering your own fieldI’ve used the timepicker extension above, and Elliot’s own datepicker field, to create a time field.
Download these files, unzip and install in your theme directory.
Add the following code to your functions.php file:
register_field('xa_time_field', dirname(__FILE__) . '/custom-fields/timepicker/time_picker.php');
(amend the appended URL as you wish, if necessary)
You should now have a “Time” field type in Advanced Custom Fields!
Around about line 158 in
time_picker.php
is where you can alter whether the JS displays datetimepicker or just timepicker.You might want to play around with
data_date-format
,data_time-format
and the format of the date string to get the output you desire.Hope that helps.
Did you find a solution to this?
the shortcode for UTM is as follows, where TAXONOMYNAME is the name of the taxonomy, and TAXONOMYFIELD is the name of that taxonomy’s field, like so:
[xy_TAXONOMYNAME ]
This echoes all of the fields associated with that taxonomy.
[xy_TAXONOMYNAME field="TAXONOMYFIELD"]
This echoes the specific field you’re calling.
You can, of course, use “do_shortcode” to output this within a template:
$VARNAME = do_shortcode('[xy_TAXONOMYNAME field="TAXONOMYFIELD"]'); echo $VARNAME;
I’m also looking for a way to query these fields within a “foreach $terms as $term” loop…
Hi Scribu,
Thanks for this; unfortunately the code you suggested doesn’t seem to do the trick. Will this code need adjusting to fit the theme? Should I be editing the ‘post_type’ to suit my theme?
Thanks again,
Xander
Hi Scribu,
I dropped you an email!rgds,
Xander
Forum: Fixing WordPress
In reply to: Displaying post revisions as seperate postsJust as a follow-up to this query, Mike has got back to me with this solution:
<?php $revs = wp_get_post_revisions($id, array('order'=> 'ASC')); //echo "<pre>" . var_export( $revs, true ) . "</pre>"; if (count($revs > 0)) { echo "<h2>Older versions</h2>"; foreach ($revs as $rev) { ?> <div class="post revision" id="post-<?php echo $rev->ID; ?>"> <h3><?php echo apply_filters( 'the_title', $rev->post_title, $rev->ID ); ?></h3> <p class="postmetadata"> <small>This revision was saved on <?php echo mysql2date('l, F jS, Y', $rev->post_date) ?> at <?php echo mysql2date('H:m:s', $rev->post_date) ?> </small> </p> <div class="entry"> <?php echo apply_filters('the_content', $rev->post_content); ?> </div> </div> <?php } /* end foreach */ } /* end if any revisions */ ?>
Which, of course, works perfectly. Mike’s left a debug echo commented out at the top of the loop. Enabling that will show you all the post structure you can get at to display.
Thanks Mike! I’ll mark this thread as “resolved”.
Xander
Forum: Fixing WordPress
In reply to: Displaying post revisions as seperate postsHi Mike,
Many many thanks for your assistance, I think that is the relevant snippet of code that I’m looking for, and thanks for pointing it out to me!
I can’t seem to get it to function in a loop though… I can call up wp_list_post_revisions and get that to return a list (which links through to the relevant page’s revisions in the back end, but wp_get_post_revisions doesn’t return anything within a page loop. Perhaps I’m not calling it in the right place? `<?php the_post() ?>
<div id=”entry-content” class=”exposeit”>
<div id=”post-<?php the_ID() ?>” class=”<?php sandbox_post_class() ?>”>
<h2 class=”entry-title”><?php the_title() ?></h2><?php the_content() ?>
<?php wp_get_post_revisions() ?>`My apologies if I’ve misunderstood your suggestion…
Thanks again for your generous assistance,
Xander
Hi Scribu,
My apologies for being an eternal idiot. I tried to recreate this issue in a different theme, and got the same error. I realised the full extent of my idiocy when I understood that the `add_filter(‘front_ed_allow_post’, ‘restrict_to_category’, 10, 2);
` snippet of code didn’t refer to the category id numbers, and was to be left alone. I had changed the “10,2” to correspond to my category id’s.Fool.
My apologies again for wasting your time, and congratulations on your ace ace plugin.
Xander
I’m using the up-to-date version of the code, with WordPress 2.8.6. I’ve disabled all other plugins to see if there is any conflict, but that’s thrown back a dud. I’ve followed the AJAX requests in the Firebug console, but it doesn’t throw any errors back at me apart from “compactMenu not defined” (onload(load) in the growfield.js file).
When I double-click the text field to edit, it doesn’t seem to populate the field with any text, and if I click “Save”, it doesn’t seem to save the edition, and returns a blank post. If I remove the code to enable the plugin to edit across all posts, the full functionality is restored.
I hope it’s not something blindingly obvious I’m missing…
Hi Scribu,
Firstly, many thanks for taking the time to create and improve on your front-end editor plugin. I’m integrating it into a website, and I’ve run across a small stumbling block…
The example code you gave for restricting the front-end editor to a single category works fantastically, I added it, changed the category fields, and it worked. However, one of the side effects of this filter is that it seems to remove the original text from the input field of the editor when editing. Prior to adding the filter to the functions.php, the input field in the editor was populated with the original content, and upon removing the filter, it is re-instated. I don’t suppose you know what might be causing this minor bug, and how to rectify it?
I’ve checked this out in Firefox 3.5.5 & Safari 4.0.3 in Mac OS 10.6.1 and I don’t have the rich text editor enabled.
Kind Regards,
Xander