Including one page with WordPress functions into another
Including one page with WordPress functions into another
Including one page with WordPress functions into another
How to Update User Meta Field other than from profile?
It seems if you use classes you have to use array($this, $function)); in the function element as shown below. add_submenu_page( $mainmenu_slug, $submenu_title, $submenu_label, $capability, $submenu_slug , array($this, $submenu_function) );
Pass jquery var to a function in functions.php
admin-ajax.php nulls all php variables
Something like the following should work: function my_header() { ob_start(); include(get_template_directory() .’/file.php’; $content = ob_get_clean(); return $content; } add_shortcode(‘include’, ‘my_header’);
How about just echoing out the needed syntax like that: echo ‘<div class=”custom-field”>’ . genesis_get_custom_field(‘instrument’) . ‘</div>’; You can also just use CSS and style the header.entry-header { //your sexy styles goes here } Since other elements inside are wrapped in their own elements and styled separately (I mean the actual H1 and meta data) … Read more
Set thumbnail from URL, by grabbing image in functions.php
Is this even possible? If your description is correct and … The function is not pluggable, by which I assume you mean not wrapped in a if (!function_exists()) condition and The function is not a callback for an action or a filter and The function is not in a theme file that gets automatically substituted … Read more
The main issue with the code snippet is this line: function randomComment_handler($post_id) { Check out the Codex on add_shortcode() and see if you can find the error. Spoiler: It should be like this: function randomComment_handler( $atts, $content = NULL ) { ps: You should also avoid using extract(), use $atts[‘post_id’] instead. Further consider adding the … Read more