Support

Account

Forum Replies Created

  • @mtv-jcil I would take suggestion of @brugman and maybe go 1 extra step (if my reasoning makes sense – see below).

    I would check for something unique about the logged in user, and if it is not a user you want to see the cog, I would add an extra CSS Class to the body tag. Why?

    This way… when doing the CSS to hide the cog, you can reference the body.(addclasshere) to the CSS Selector so that your agency users could still use it and just not other users.

    Yes, not really necessary, but it could make sense to shave some service time off (over time). As I do use the cog at times when needing to add/edit the field group to save on going through Admin Menu > Find Group > etc. Some bigger (or older) sites some times take me a bit long to find it going through the multi-step approach.

    Just my .02

  • Right on @julescolle — glad you were able to find things out man and I have been noticing disappearing messages too 🙁

  • I got to agree with @hube2 here – this is not the place to be sharing such opinions. As with your opinion of ACF not using WP right – I personally don’t feel you are using this community support tool right either – in that kind of analogy.

    The “entire” WordPress community (as you mentioned) does not fit what you are saying. Like any business/product/service, there are niches and finding the right one to benefit your needs/desires is important. But, nothing is a 1 size fits all. If it doesn’t fit yours… either move on to something else that does or more productively, learn to do it on your own instead of relying on something else.

    In theory… we don’t have to use WordPress to build a website, but it improves the experience, turnaround time, security and so much more. Therefore, it is a tool that helps make things easier, just like ACF.

    Obviously… WordPress is not providing you a “Fully Featured Tool” as you are having to go beyond its native abilities too, right?

    I respect and feel you have frustrations, but what is really going to be the expectation or result of this posting?

    WordPress Ecosystem in general gets a bad wrap for such theories.. as you have actual real developers, enthusiasts, power users, do-it-yourselfers, and I can go on. Every one has its strengths and weaknesses (and at various levels). Nevertheless, at the end of the day… the real spirit is code and anything beyond coding things ourself… is merely a tool that can be subjective to your opinion.

    Open Source for that matter… that is the real spirit. Take what has been given to us and utilize it for what it is, or help others out and contribute to it to help it and others using it grow.

    Just my .02 – sorry you feel frustrated.

  • @sirvav 1 option would be to create an array of the values from the query, and then utilize array_sum() PHP function

    Reference: https://www.php.net/manual/en/function.array-sum.php

  • @hsterr download the ACF v6.0.5 from your online account. Replace current plugin with your desired version.

    Direct Link @ https://www.advancedcustomfields.com/my-account/view-licenses/

  • @whynotadv from what I can gauge, you want it to render more like a grid (2 columns per row) and continuously create new rows after each 2 listings?

    OPTION A:

    CSS Grid would play perfectly. You can set columns to split evenly in width (grid-template-columns: 1fr 1fr), and after each 2 items css grid would break to a new row automatically for you. Depending on existing styles and so forth, it will take a bit more in CSS, but definitely achievable and pretty straight forward with CSS Grid Layout knowledge.

    Which can then be adjusted for mobile responsive when needed. Say when you hit iPad, you can change to grid-template-columns: 1fr (instead of 2 1frs) and now it changes back to a single item per row without having to change any HTML

    The other cool thing here is that it can then be configured to have all rows with equal height or they could vary. Up to you.

    OPTION B:

    You can hack a bit by using a counter in PHP and conditionally add in container stuff after each 2 items, but CSS Grid is way better and so much more flexible.

  • @damian0021 – you can use something like the custom wrapper attributes to the fields so that it is easier to select items to style on your own. Option is available for you when you are creating each field.

    Then it would come down to CSS and potentially JS/jQuery.

  • @billy_mac – you should be able to replace the line:

    the_title(
    '<h3 class="wpgb-map-marker-title"><a href="' . esc_url( get_the_permalink() ) . '">',
    '</a></h3>'
    );

    with:

    echo '<h3 class="wpgb-map-marker-title"><a href="' . esc_url( get_the_permalink() ) . '">'. get_field( 'FIELDNAMEHERE' ) .'</a></h3>';

    just make sure FIELDNAMEHERE is changed to the field name you setup. Depending on your page template setup, this should work out of the box.

    Otherwise, you may need to configure the get_field() a bit differently (see reference link)

    — the_title() documentation shows a bit of how it formats in correlation with the Post/Page Title, so basically, removing that function and echo-ing it in without the assistance. See Reference

  • Hey @julescolle – if I am heading down the right path for you, you merely want to set default values for fields (if no value is entered yet)?

    One way is that you can set default values right from the get_field() without any conditional logic snippets.

    $example = get_field( 'cpar_example' ) ?: 'use this value if not entered';

    This would then display block preview with those default values when first added to the editor and/or preview. Then when entering a value into the fields, it would override.

    Hope this helps…

  • @tiger217 are you trying to display it on a page template setup for the Custom Post Type? For example, if you created a Portfolio CPT (portfolio), are you using a single-portfolio.php page template?

    Otherwise, if you are doing it from a different template, you will need to identify that in your get_field()

    Reference: https://www.advancedcustomfields.com/resources/get_field/#get-a-value-from-different-objects

  • Hey @samsmyth — I like to keep functions file clean too. Therefore, either from your functions file or a loader file elsewhere, you can use a foreach (changed to your directory structure idea)

    — basically you need to load the JSON file for each block.

    add_action( 'init', 'cpar_acf_blocks' );
    
    function cpar_acf_blocks() {
    
        foreach ( glob( get_stylesheet_directory() . '/blocks/*/' ) as $path ) {
    
            register_block_type( $path . 'block.json' );
    
        }
    
    }

    This will then dynamically check each folder within the blocks directory you made and look for its corresponding block.json file. I like this approach where I can then just add new blocks in and not have to add more code to load each one I add.

    Hope this helps…

Viewing 11 posts - 1 through 11 (of 11 total)