Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

reply

  • If not using inner blocks, try setting JSX as false in the json file:

    "supports": {
            "jsx": false,
        }
  • Thanks well I was just going to post and your were faster than me 😀 I made a very silly mistake: instead of this:
    $superficie = $group['superficie_o_potencia'];

    I should had been:
    $superficie = $group['superficie'];

    I’m afraid I was too quick assuming things..

    Nevertheless, I confirm using get_queried_object does work just fine as well, and may use it in the future, thank you so much!!

  • These questions would be something you’d have to ask the theme and plugin developer. There should be a single template or hooks that can be used rather than creating a custom template for each product. You’re not likely to get the answers here.

  • Continuing from your other post:

    
    add_shortcode('showpptime', 'display_presto_content');
    function display_presto_content($atts=array, $content='') {
      $value = '';
      if( have_rows('my_presto_player') ):
        while( have_rows('my_presto_player') ) : the_row();
        $timestamp = get_sub_field('presto_time');
        $optional_text = get_sub_field('presto_topic');
        if (!empty($timestamp)) {
            // Build the shortcode with the timestamp and optional text
            $shortcode = '[pptime time="' . esc_attr($timestamp) . '"]' . esc_html($optional_text) . '[/pptime]';
            $value .= do_shortcode($shortcode);
        }
      return $value;
    }
    
  • This is because on the “Author” page WP is querying the author, but on the single post page WP is querying the post.

    Elementor can only get values from the currently queried object, that means that on the single post page it can only get values from the post and it will not be able to get values from the user that created that post. I don’t know if this ca be done in elementor with one of their widgets, you might want to look at the “Author” widget for your single posts, but like I said, I don’t know if this widget has the ability to add custom fields.

    You might need to create custom code to do this, I do not have any examples I can point you to. It will likely mean creating a custom shortcode and in the shortcode getting getting the post ID, then getting the user (author) ID and returning the value from the ACF field for the user.

  • Have you looked at any of this [SEARCH RESULTS]

  • If you are in the header then you are outside of “The Loop”. When you are outside of the loop you must provide ACF with the post ID of the post you want to get the value from because ACF cannot determine the correct post outside of the loop.

    If what you are looking for is on a single post object then you would use something like

    
    $queried_object = get_queried_object();
    $group = get_field('caracteristicas', $queried_object);
    
  • I can’t tell you how to use “ACF: Better Search”. This is a plugin by another developer and I do not use it.

    What I do know is that you cannot alter the “s” parameter in the WP search to include searching a post based on a taxonomy.

    You would need to have a separate field that listed the terms in the taxonomy where the value submitted is the term_id for each term. Then you would need to alter the query done during the search to add a tax_query.

  • Thanks for the details. Another question. How do I know the metakey of a text field integrated within posts. For example, the text field name is product-name.

  • It also has a setting that enables/disables adding terms.

    I can’t find this setting either.

    Where is it exactly?

  • The taxonomy field has the option of using a radio button for presentation

    Sorry for the dumb question, but how can this be done?
    I can’t find this option in the configuration for a custom taxonomy.

    In a test site, I managed to do this with the help of a third-party plugin. But I can’t see a way to do this within the ACF settings for a custom taxonomy.

  • Do you plan to use a new CPT to show animals instead of WC? Allowing them to continue editing in WC and using another CPT would mean you’d need to duplicate all of the existing posts and also duplicate and/or update the related CPT every time something is added/edited/deleted. This really would be more work than just building a new site.

    You could replicate most of it, but you can’t replicate the WC attributes without a lot of work. WC is special in that each “Attibuted” is a taxonomy that is created on the fly in the admin. They are basically nested taxonomies. Each “Term” in the “Attributes” is actually a custom taxonomy and attribute value is a term in the custom taxonomy.

    I hate to be the bearer of bad news but the only way to move out of WC would be to build a new site. I imagine that whoever built this used WC to reduce the amount of work that would be needed or that they were not able to do all the custom coding that would be required.

  • There is no automated way to move the data from one to the other.

    Data is stored in the _termmeta table by the term_id. When you create a new “category” this is a new term with a new term_id even if the name/slug is the same as the original “tag”.

    Moving the data would require doing an DB search for all the _termmeta connected to the old term_id and replacing it with the new term_id.

    You could, potentially, use the WP create_term hook. In the hook you could search the tags for a matching slug and then copy all of the ACF fields using get_field() and update_field(). Note that you will need to use the field keys to do the update process and NOT the field names.

  • I don’t know anything about Avada, all I can give you is a link to a general guide that explains how to get posts based on a relationship field.

    https://www.advancedcustomfields.com/resources/querying-relationship-fields/

  • You cannot search one post type by content contained in another post type. The only thing that ACF stores for a Post Object field or Relationship field is the post ID or array of post IDs for the post or posts that are selected. So the only thing you can search by it the ID of the post. How the query would need to be build would depend on what type of field you are using and whether or not is stores a single value or an array of values.

    This is a guide that shows how to search based on an array in a relationship field
    https://www.advancedcustomfields.com/resources/querying-relationship-fields/

  • This code may help you:

    <?php
    
    // get the current user id
    $id = get_current_user_id();
    
    // get a field from the user
    $variable = get_field('field_name', "user_{$id}");
    
    ?>
    <!-- Display the field from the user -->
    <p><?php the_field('field_name', "user_{$id}"); ?></p>
    
  • Many thanks John! For anyone looking for a similar functionality, this is what I did and it worked well.

    function pm_login_redirect( $redirect_to, $request, $user ) {
    	$redirect_to =  '/dashboard';
    
    	if ( isset( $user->roles ) && is_array( $user->roles ) ) {
    		//check for subscribers
    		if ( in_array( 'subscriber', $user->roles ) ) {
    			//check the user status
    			$userstatus = get_field('Status', $user);
    			
    			if ($userstatus ==='Disabled') {
    				wp_logout();
    				wp_redirect('https://www.google.com' );
    				exit();
    			}
    		} else {
    			// redirect the other subscribers to the default place
    			return $redirect_to;
    		}
    	}
    }
    
    add_filter( 'login_redirect', 'pm_login_redirect', 10, 3 );
  • Hi John,

    Thank you so much for helping me with this. I’m very new to ACF & obviously not that strong at writing functions.

    I tried your suggestion adding the shortcode [showpptime] to a post, but doesn’t show the fields output, it just displays [showpptime]
    It should be displaying the “optional text” as a link to a timestamp in a Presto Player video.

    The original shortcode I am trying to use as a repeater is:
    [pptime time=”1:08″]Optional Text[/pptime]

    “pptime time” being the field “presto_time” and “Optional Text” being the field “presto_topic”.

    The developer of the Prestom Player sent me the following to use:

    $timestamp = get_field('timestamp_field');
    $optional_text = get_field('optional_text_field');
    
    // Use do_shortcode to display the content
    echo do_shortcode('[pptime time="' . esc_attr($timestamp) . '"]' . esc_html($optional_text) . '[/pptime]');

    “This code retrieves the values from the ACF fields and processes them through do_shortcode, creating the desired output.”

    Big thanks in advance for any help you can offer.

  • Your shortcode is just running shortcodes and not producing anything.

    First your loop should be inside of your shortcode function.

    Second you need to return the html

    this is just a guess, but hopefully you get the idea.

    
    function display_presto_content($content) {
    ob_start();
    if (have_rows('my_presto_player')) {
        while (have_rows('my_presto_player')) : the_row();
            $timestamp = get_sub_field('presto_time');
            $optional_text = get_sub_field('presto_topic');
            if (!empty($timestamp)) {
                $shortcode_content = '[pptime time="' . esc_attr($timestamp) . '"]' . esc_html($optional_text) . '[/pptime]';
                display_presto_content($shortcode_content);
            }
        endwhile;
    
      return ob_get_clean();
    }
    
    add_shortcode('showpptime', 'display_presto_content');
    
  • You cannot do this because a every repeater sub field has a different meta key.

    This might be one way to work around this problem https://web.archive.org/web/20190814230622/https://acfextras.com/dont-query-repeaters/

  • You’re going to have to contact the developers (WPEngine) on this one. The “acf-disabled” status is added by ACF and applied to field groups and fields when a field group is disabled. It should not be applied to queries for posts other than post types managed by ACF. In my mind this is a bug adding this post status to all post types. You can contact them here or open a ticket on your account.

  • I’ve done a dive into the code and I don’t see any way to modify the admin UI page for options pages. Logically, there should be because it is a post type, and you should be able to add field groups to this post type. Obviously ACF is preventing this. I’ve also found no filters that would allow changing this.

    I hate to say this but once again I have to say that you should contact the developers directly. They don’t monitor these forums and are not likely to see your question and they are likely the only people that could answer it.

  • I know this forum is called “Feature Requests” but the developers of ACF do not look at these forums. Try posting here https://www.advancedcustomfields.com/feedback/ or contacting the developers directly.

  • The ACF shortcode is only good for simple fields. A link field would be considered a complex field because it stores an array of values. This would require building a custom shortcode.

    You might also look to see if your theme provides any guidance on using ACF.

  • If you are looking for a plugin option, unfortunately it appears that all of the plugins that would do this are no longer maintained.

    There are a multitude of coding examples available.

Viewing 25 results - 3,076 through 3,100 (of 21,345 total)