Hi,
I downloaded the plugin and added the Google Font Key. When I go to the ACF plugin, I see Typography under field type but what do I do from here to change certain font texts? Could you provide a video or instructions on how to make ACF font changes using your plugin? I added a snapshot of what I am trying to change. Thank you.
View post on imgur.com
]]>
Hi, first many thanks for your plugin!
I use Playfair Display but I can’t have weights I need. Seems there is just regular “bold”. in json file i can see all weights but compared to google font i have just regular and a bold that seems to be 600. Even if I choose 700 or 800. Did I miss something ?
I I check header font link I don’t see any weight spécification : https://fonts.googleapis.com/css?family=Open+Sans%3A400%2C700%7CPlayfair+Display&ver=6….
Last point is it possible to ass swap to header font link ?
Thanks for your answers !
Best regards
I’m building a new theme for a client and noticed these messages pop up when I hit a bad URL (404 not found) and there’s no 404.php template specified for the theme:
Notice: Trying to get property ‘ID’ of non-object in /path/to/wp-content/plugins/acf-typography-field/includes/functions.php on line 84
Notice: Trying to get property ‘post_content’ of non-object in /path/to/wp-content/plugins/acf-typography-field/includes/functions.php on line 88
The obvious answer is: Add a 404.php template file since every theme really should have one anyways. But it’s not a REQUIRED file, and quite a few themes don’t have one. The theme I’m creating is a single page theme with ZERO other pages at all, so there’s no point in having the 404.php template.
I’m getting around this with a little code snippet to redirect any 404 back to the home/index.php page:
function fol_redirect_to_home_404() {
if (is_404()) {
$url = trailingslashit(get_home_url());
wp_redirect( $url );
exit;
}
}
add_action('get_header', 'fol_redirect_to_home_404');
Even still, I can’t help but think there should be some sort of check within this plugin. Not sure the best way to go about it since some people may actually be using your plugin within 404 pages.
Perhaps check IF is_404() && 404.php exists within the theme, THEN do the code in functions.php starting on line 84. Otherwise, skip it.
It’s not so much an issue with your plugin, but it is something I ONLY encounter with your plugin when there’s no 404.php template. Perhaps it should be accounted for?
]]>Hello. Just a quick question about how to enqueue the necessary stylesheet code for selecteed fonts within a custom function.
I have a function that creates a PDF file from custom post types/taxonomies. It is using the DomPDF library that converts HTML to PDF.
What do I need to add to the HTML in order to actually include the CSS for the selected font styles within your plugin?
For example, within the HEAD tag, I’m including my custom stylesheet in a pretty standard fashion:
$html .= '<link type="text/css" media="dompdf" href="'.get_template_directory() .'/css/styles.css" rel="stylesheet" />';
Note that with DomPDF, I’m using a local path, not the URL.
I can get the values set within the ACF Typography fields just fine. What I can’t get it to do is actually include the CSS in order to render the font styles properly. Looking to do something like this:
$font = $page_opts['font']; // get the font field values array
$html .= '<style> @font-face { font-family: '.$font['font_family'].'; font-weight: normal; font-style: '.$font['font_style'].'; src: url('fonts/FONTFILE.EXT') format('FONTFORMAT'); } </style>';
…or get the auto-generated code that is automatically enqueued/included on front-end posts.
Thanks!
]]>I was wondering if your plugin supports PHP 8.0? I updated and when I edit a plugin which uses typography fields I get a WP Critical error
]]>Hi,
noticed that there are some font weights missing that I needed. I had a look in fields/acf-Typography-v5.php, found the array on lines 102-108, and tried adding the missing values (200, 500, 900), seems to work fine. Could you just add that to the next update, or do I have to add it in the github repo?
Hello,
I am trying to get my font family and font size etc from the ACF Options Page – how can I do this?
I have tried the following;
$body_content_font = get_typography_field( 'body_content_font', 'font_family', 'option');
var_dump( $body_content_font );
This just shows me an empty string.
ACF Settings: https://gyazo.com/763a4806bd3f581bfa407bd90825d25c
Thanks,
Javed
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.
]]>Does this plugin allow to add font fields to any admin page using ACF function like acf_add_local_field_group and passing type => ‘typography’?
]]>Hi I have selected the Typography field and selected font-family for the ‘options’ field i want to show this on but only limited google fonts show as you can see here https://www.dropbox.com/s/e7m9t59vh4e1irk/Screenshot%202021-06-19%20at%2013.38.26.png?dl=0, how can i enable more fonts and for the user to search for a desired font?
]]>Hey,
First of all great plugin, thank you!
One thing i noticed while using the plugin which you may want to fix:
array_merge_recursive in acft\includes\functions.php on line 97 produces a warning as its arguments may not be arrays if no fields are defined for a specific post or no option fields are present. An easy fix would be to exchange lines 91 and 92
$all_post_fields = get_fields($post->ID, false);
$all_option_fields = get_fields('option', false);
with
$all_post_fields = get_fields($post->ID, false) ?: array();
$all_option_fields = get_fields('option', false) ?: array();
]]>
I am using your ACF google font picker on a content type, and its displaying front end perfectly on its own page: https://orqadesign-development.com/project/spotlight-series/
Im also pulling this content through into the homepage slideshow here: https://orqadesign-development.com/
And on this page: https://orqadesign-development.com/our-work/
Where the font stops working, i can see in the mark up that the acft-gf-css style sheet is not loading on this page, but is for the other 2 – can you advise why?
focus on the Spotlight heading text.
thanks!
]]>I am setting multiple typography fields wit different defaults of font sizes:
body copy – 16px
h1 – 60px
and so on.
When I go to edit the field, the default is automatically set to 15 and if I don’t change the field it then outputs 15 (instead of the default I chose).
Am I doing something wrong, or is something not working correctly.
]]>Hey,
I thought I’d let you know of a bug that’s causing us some headaches.
When using the typography as a sub field of a repeater and specifying different font weights for each row, only one of the font weights gets enqueued.
For testing:
1) Setup repeater row with typography field.
2) Add 2 rows, both with Open Sans Condensed font family
3) Choose font-weight 700 for first row, choose font-weight 300 for second row.
4) Check the enqueued google stylesheet, it will only include the 700 font-weight.
Here’s the link that get’s added for us: <link rel='stylesheet' id='acft-gf-css' href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed%3A400%2C700%7COpen+Sans+Condensed&ver=1568125540' type='text/css' media='all' />
Hello! I apologize for this elementary question. Now that I’ve installed ACF and this plugin (and entered my Google Fonts API key), I can’t figure out where to go to change the fonts for my custom fields. I’ve looked in the original field group where I designed my custom fields and don’t see any design options there. Then, I’ve looked on my template where I’ve inserted the custom field in my page builder, but there doesn’t seem to be any options there (except for alignment and extra class name). Am I supposed to be writing the CSS code? I was hoping for options to select instead (as I don’t write code). Can you point me in the right direction, please? Thank you!
]]>I’m using the typography field in ACF option page & i’m calling it like this in <head> section.
.navbar .navbar-top li a {
font-family:<?php the_typography_field( 'main_navigation_font','font_family','option' ); ?>;
the result is
.navbar .navbar-top li a {
font-family:Junge;
}
the thing is Google Fonts is not enqueued & not showing the correct font-family
]]>After installing and inputting my API key, i get the following error:
Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/membership/public_html/wp-content/plugins/acf-typography-field/fields/acf-Typography-v5.php on line 380
Warning: Invalid argument supplied for foreach() in /home/membership/public_html/wp-content/plugins/acf-typography-field/fields/acf-Typography-v5.php on line 382
How can i fix this?
]]>I’m using this field on an options page, how would I get the value that is set there? From what I can see, all of the functions require a post ID.
]]>Hi there,
Thanks for this plugin! Question: can I register my own fonts or it will only work with Google Fonts?
Thanks,
Martin
The plugin doesn’t work with ACF 5.7.7
]]>Hello,
I want to use the Typography plugin to give a custom font size to a text field. So I have a group field, with those two subfields (text + typography), but the typography doesn’t affect at all the text field. And the output is just an “Array”.
Thanks
Hey, any news on the Google Fonts support? ??
]]>Hello sir,
I have another issue. Typography settings are not displayed please check this. Also, check with woo-commerce plugin because Google fonts are not working then active Woo-commerce.
https://www.awesomescreenshot.com/image/2641326/16b114d5a0e563e0c64e116dc0a1772b
Thank you
]]>Hello sir,
I have updated your plugin but I have faced Warnings. Please resolve this issue.
https://www.awesomescreenshot.com/image/2641282/18f1d7199dabced79966de76c7b70423
Thank you
]]>Your plugin issue https://www.awesomescreenshot.com/image/2570691/d9a1373338f461ad2d7aa3843123e68c please solve asps
Your plugin (acf-typography) is not compatible with woo-commerce 3.0.x. I need to font family and I would like to change the font type and font type with subset cause our language has special characters and I do not want to handle this font.
Can you please tell me the time-frame? When you make the plugin compatible with woo-commerce 3.0.x.
]]>