Support

Account

Forum Replies Created

  • next_posts_link( 'Older Entries', $getmysiblings->max_num_pages );

  • My hunch is get_the_ID function isn’t returning anything. Var dump it out before query to check?

  • Pretty sure you can add the title to the new post like so:

    <?php
    
         acf_form(array(
            'post_id'       => 'new_post',
            'post_title'    => false,
            'post_content'  => false,
             'new_post'     => array(
                  'post_type' => 'tickets',
                  'post_status' => 'publish',
    'post_title' => 'my title'
             ),
             fields' => array('field_5ba8b0c6a5116', 'field_5ba8b08c96be1'),
         );
    
    ?>

    Seems nicer, but you don’t have access to the new post ID πŸ™

  • Ah. Yes. This is the intended functionality. Never considered syncing the values of option pages. Perhaps you might consider a network option for these fields? This way your value can be accessed by all sub sites?

    https://codex.wordpress.org/Function_Reference/get_site_option

  • sounds like it could be a connection issue. Check your console when updating your licence key to make sure there are no connection errors

  • I get this issue now and again and usually comes from conflicting naming convention on your fields or if you have some field groups registered in both json and in the DB that are sharing field keys for some reason (human error)

  • Will this be able to sync the values entered into the fields? So if for example I update a custom field on Site B, then that value would be saved and synced to Site A too.

    Absolutely. This is its primary purpose.

  • Hey guys I developed a customisable solution for this. Check out my post here: https://support.advancedcustomfields.com/forums/topic/multisite-sync-solution/

  • Hi Elliot. My issue with tinymce seems to have persisted unfortunately. See my above post.

    Just to confirm my scenario for debugging:

    • If visual editor is default tab it’s not working (switching to text tab works)
    • If text tab is default, I can switch to visual tab and it works.
    • It’s a form in a user Add/Edit form. However I am pulling the acf_form to a front end template page and behavior is the same.
    • I’ve tried deactivating all my plugins apart from ACF. No change.
    • I’ve tried removing all other jQuery based fields from my field group. No change.
    • WYSIWYG working fine on pages flexible fields. (don’t get that at all)

    Let me know if there is anything else I can do to help debug from my end. I’m out of ideas here.

  • Can I just add more fuel to the fire here, maybe my info will help identify any issues.

    What I am experiencing is on acf_forms frontend. If The user is defaulted to the ‘visual tab’ on the WYSIWYG editor when the page loads the WYSIWYG fails to fully instantiate. However if the user is defaulted to the ‘text’ tab and then clicks on the ‘visual’ it loads fine.

    See attached screen grab of my console error when you click on the ‘visual’ tab when the WYSIWYG when you the page load brings in the ‘visual’ tab as default

  • If you can be more specific as to what method you are trying to use then I can provide an example because they can absolutely be used for logic. Pretty much the whole reason for them πŸ™‚

  • If I understand correctly there are already checkbox fields and radio button field types that you can change your custom field too…See the ‘Field Type’ dropdown.

  • To get the tax terms for that page you can use this:
    https://codex.wordpress.org/Function_Reference/get_the_terms

    Then plug this into a get_posts

    get_posts(array(
        'post_type' => 'quotes',
        'tax_query' => array(
            // get_the_terms() stuff.
        ),
        'order' => 'ASC',
        'posts_per_page' => 5,
        'orderby' => 'rand')
    );
    ?>

    Note: This is off the top of my head but I hope it sets you on the path to your answer πŸ™‚

  • Just googled it. Appears to be a solution here:

    https://wordpress.org/support/topic/orderby-multiple-meta_key

  • You have to have your order by argument as an array:

    $q = new WP_Query( array( 'orderby' => array( 'sticky' => 'DESC', 'published' => 'ASC' , 'hidden' => 'ASC' ) ) );

    Need to be careful how you are calling these keys in though. Remember you need

    'meta_key' => 'start_date', argument in there too.

    I’ve never tried it will muliple custom fields but i’m guessing you will have to have the matching keys as an array also.

  • what do you mean the check isn’t in the loop? In my code above the if is wrapped in a while loop? Just replace with the syntax you are using for The Loop?

  • while(){
    
    if( in_array( 'red', get_field('field_name_of_checkbox') ) )
    {
        //...Your code
    }
    
    }

    Be careful though because if there is nothing checked I think the field returns a string. This is off the top of my head. Not sure.

  • Sounds like you should be using Taxonomies matey. https://codex.wordpress.org/Taxonomies

  • Me too!

  • I don’t understand why you would need this functionality as it is already built into wordpress?

    http://codex.wordpress.org/Writing_Posts

  • Sorry. I’ve just looked at this further and it looks like you are messing up the two methods as mentioned in this page? http://www.advancedcustomfields.com/resources/relationship/

    So the foreach you have used in your original code doesn’t need the <?php wp_reset_postdata(); ?> so you could remove that or you could use the first method in the linked example but you would have to restructure your $post and $p variable names.

    Hope this helps!

  • Mate! I’ve just realised you’ve missed something after your foreach begins you have to set up the post data. Surely that will fix the weird activity?

    <?php foreach( $posts as $post ): ?>
    <?php setup_postdata($post); ?>
  • Yeah.. My first thought was the $posts variable not resetting. Try sticking the <?php wp_reset_postdata(); ?> after the closing ul tag because it looks to me there may be some instances in that loop where it wouldn’t be reset or would be reset before you needed it to be.

  • I think this is expected behavior. Updating the way the field returns data would require you to update the field in the database by updating the post.

  • PS. You can get the post author from the $post object in the function I’m sure.

Viewing 25 posts - 1 through 25 (of 30 total)

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.