• Resolved ekajatik

    (@ekajatik)


    I need to do the following:

    <?php wp_list_bookmarks(‘categorize=0&category=X&before=<span>&after=</span>&show_images=1&show_description=1&orderby=url’); ?>

    I need to replace the X in category= with the content of a custom field, what is the syntax? I guess use:

    <?php the_field(‘links’); ?> to output the custom field value, but how do I put them together, every way I’ve tried so far gives errors?

    Thanks

Viewing 3 replies - 31 through 33 (of 33 total)
  • Just checked the plugin page says it creates it’s own tables to improve speed, not sure how much of a benefit that is.

    Now uses custom Database tables to improve speed, reliability and future development

    Anyway mark this as resolved please.

    David

    Thread Starter ekajatik

    (@ekajatik)

    I saw that yes, but also saw that the developer had decided to try to bring it into line with standard CF and put them in the right tables but he cannot and is asking for users to help out.

    marked as resolved, thanks for the help.

    The feature of Advance Custom Fields is the different types like checkbox, textarea, wysiwyg etc:, so they could give the user the option to use their table and calls, WordPress standard or both.

    Why do they need to put them in the WordPress wp_post_meta tables, and not just use the WordPress API calls?

    function acf_update_post_meta($post_id, $key, $data) {
    	$post_meta = get_post_meta($post_id, $key, true);
    	if( $data != '' && $post_meta != $data) {
    		update_post_meta($post_id, $key, $data);
    	} elseif ( $post_meta != '' && $data == '' ) {
    		delete_post_meta($post_id, $key);
    	}
    }

    In the ACF code just pass in the values, so the user can use the standard code to retrieve the value with both the WordPress or ACF code, when the user delete the ACF pass in a blank value.

    acf_update_post_meta($post_id, $key, $value);

    Add or Update:

    acf_update_post_meta( $post->ID, 'links', 366 );

    Delete:

    acf_update_post_meta( $post->ID, 'links','');

    B.T.W: they have a great looking paid Live Edit plugin, I will be getting that one for sure, I am always adjust the post text after reading it back.

    HTH

    David

Viewing 3 replies - 31 through 33 (of 33 total)
  • The topic ‘Need to add variable to function’ is closed to new replies.