• I am developing a plugin. In this plugin I am outputting some HTML using short-code. User can choose font size of HTML content from Admin Panel.
    This plugin is saving font size as meta value in Database. How can I fetch and use this font size in HTML content ? Some sample code is helpful in this regard.
    (Sorry for my poor English).

    • This topic was modified 2 years, 3 months ago by Jan Dembowski.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @mabufoysal
    As per i understanding you query please try this wordPress function
    1) if you are store font size in meta then you can fatch and use font size using this function

    <?php $meta_value = get_post_meta( get_the_ID(), ‘meta_key’, true ); ?>

    <h1 style=”font-size: <?php echo $meta_value; ?>”></h1>h1>

    2) If you store font size using option in your plugin.

    <?php $option_value = get_option( ‘option_key’ ); ?>

    hope this help you

    Thread Starter mabufoysal

    (@mabufoysal)

    Thanks @pintutrivedi . Is it possible to use CSS class in this regard ? Thanks.

    Hello @mabufoysal

    Yes. You can use your meta value as your class name.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Font size of HTML content’ is closed to new replies.