php - Add description feature to wordpress theme -
i have section in wordpress theme started scratch, in section have title, tagline , description.
i displaying them using:
for title:
get_bloginfo();
for tagline:
get_bloginfo('description');
i need way user can write longer description of site , display it.
i found on google how add meta descriptions that's not want.
wordpress keep info in options table. can same yours. checkout following functions in wordpress documentation:
- update_option - saving description
- get_option - getting and/or using value
- delete_option - deleting value
you need have unique key name example desc_long
using purpose.
here example snippet code:
// save value in database update_option('desc_long', $_post['input_field_name_in_form']); // remove value database delete_option('desc_long'); // in theme use following retrieve value get_option('desc_long');
as far can remember can not add functionality existing setting pages admin can entry long description , save it. if have theme option page place put functionality, otherwise have create it.
Comments
Post a Comment