1899 posts Multimedia Artistry
  • Elite Author
  • 4 Years of Membership
  • Freebie
  • Most Wanted Winner
+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.

202 posts Quality Templates
  • Affiliate Level 3
  • Author Level 7
  • Collector Level 2
  • Elite Author
+3 more
ThemeRox
says

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

1899 posts Multimedia Artistry
  • Elite Author
  • 4 Years of Membership
  • Freebie
  • Most Wanted Winner
+4 more
dnp_theme
says

OptionTree, but that does not matter.

1899 posts Multimedia Artistry
  • Elite Author
  • 4 Years of Membership
  • Freebie
  • Most Wanted Winner
+4 more
dnp_theme
says

get_file_contents instead of wp_remote_fopen would do !!

by
by
by
by
by
by