1775 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.

196 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
+4 more
ThemeRox says

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

1775 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.

1775 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 !!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by