• Resolved idnshouter

    (@idnshouter)


    Hi, when i use:
    get_typography_field( $selector, $property, [$post_id], [$format_value] );

    Inside a variable, like this:
    $a = get_typography_field( ‘field_name’, ‘font_size’ );

    It is not working.

    Can i just use is like:
    $a = get_field(‘field_name’); or something else?

    How can i get it to work?
    What is the format value anyway?

    Thanks, this is really a good add-on for ACF pro.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter idnshouter

    (@idnshouter)

    I saw the documentation on Github like this:

    $getTypography = get_field(‘typography’);
    echo $getTypography[‘font_size’];

    But when i try it, it is also not working

    Plugin Author Mujahid Ishtiaq

    (@mujahid158)

    @idnshouter Are you trying to fetch the data inside a loop or outside the loop?

    If inside the loop;
    $var = get_typography_field( $field_name, $property)
    Example: $var = get_typography_field( 'typo', 'font_family');

    If outside;
    $var = get_typography_field( $field_name, $property, $post_id)
    Example: $var = get_typography_field( 'typo', 'font_family', 123);

    Make sure you replace $field_name to correct field name you choose when you created the field under the Custom Fields tab.

    Plugin Author Mujahid Ishtiaq

    (@mujahid158)

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get typography field inside a variable’ is closed to new replies.