1702 posts Multimedia Artistry
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Contributed a free file of the month
  • Won a Most Wanted contest
+4 more
dnp_theme says
I am having a function here
function fontlist() {
    $fontsSeraliazed = wp_remote_fopen( get_template_directory_uri().'/assets/fonts/gfonts.txt' );
    $fontlist = json_decode( $fontsSeraliazed, true );
    return $fontlist;
}

and another part of code that is supposed to do give me the value of each item of the list

$fonts = fontlist();
foreach ( $fonts>items as $key => $font) {
  echo esc_attr($font->family);
}

It does not work for me, anyone has any clue on what can I do, I am very close to launching my first wp theme … :)

Thanks for any reply.

192 posts Quality Templates
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
ThemeRox says

No. Same Problem here. By the way which framework are you working? Custom or any existing? Thanks

1702 posts Multimedia Artistry
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Contributed a free file of the month
  • Won a Most Wanted contest
+4 more
dnp_theme says

OptionTree, but that does not matter.

1702 posts Multimedia Artistry
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Contributed a free file of the month
  • Won a Most Wanted contest
+4 more
dnp_theme says

get_file_contents instead of wp_remote_fopen would do !!

by
by
by
by
by
by