Template Functions
Read SiteNivo field values in themes and plugins with a small, consistent API.
Basics
// Current post in the loop
$value = sn_get_field( 'field_key' );
// Explicit post ID
$value = sn_get_field( 'field_key', 42 );
// Options page values
$value = sn_get_field( 'field_key', 'option' ); // or 'options'
// User / term meta contexts
$value = sn_get_field( 'field_key', 'user_7' );
$value = sn_get_field( 'field_key', 'term_15' );
// Echo helpers (escaped for scalars; kses for WYSIWYG/oEmbed; link markup for Link fields)
sn_the_field( 'field_key', 42 );
Return shapes
- Scalars — strings/numbers for text-like fields
- Images — often arrays with id/url/sizes depending on formatter
- Relational — post objects / IDs depending on field settings
- No
sn_have_rowsin Free — Repeaters are Pro