How can I use a text and a function php
Try <?php echo “Right sidebar”.get_the_content(); ?> Don’t use echo for the_content, it’s already echoed out, use get_the_content instead.
Try <?php echo “Right sidebar”.get_the_content(); ?> Don’t use echo for the_content, it’s already echoed out, use get_the_content instead.
Figured it out after thinking it through.. if (stripos(strtolower($template_filename), ‘home’) !== false) { $results[] = $template_name; }
This does seem like a corrupt WP core with missing files. You can attempt to repair it by uploading a fresh copy of core in place. The procedure would be along the lines of Manual Update documented in Codex. However I want to note that pieces of WordPress core don’t just disappear for no reason. … Read more
If you want to concatenate function result into a string you should be returning it, not echoing it. Echo just sends it to output. Also you are making a typical mistake of confusing two flavor of WP template tags. Convention is the following: the_* template tags echo result immediately; get_the_* template tags return result. Internally … Read more
Looks like you have the Posts for Page plugin installed. I don’t know where you have put that code you mention, but the page is generated by the shortcode, which says that output should be limited to the beauty category. You probably don’t need to write code yourself. Read the manual of the plugin and … Read more
Assuming that the hook you have used is correct; below is the updated code which you can use: function custom_listify_single_job_listing_actions_after() { global $post; if( $post->ID == 1464 ) { $url = get_post_meta( $post->ID, ‘your_custom_meta_key’, true ); echo ‘<a href=”‘ . esc_url( $url ) . ‘” class=”button”>My Button</a>’; } } add_filter( ‘listify_single_job_listing_actions_after’, ‘custom_listify_single_job_listing_actions_after’ ); Let me … Read more
@Dan meant this: <nav role=”navigation” itemscope=”itemscope” itemtype=”http://schema.org/SiteNavigationElement”><?php wp_nav_menu([ ‘container’ => ”, ‘items_wrap’ => ‘<ul>%3$s</ul>’, … ]); ?></nav>
You can filter the link returned by wp_get_shortlink() using get_shortlink filter. add_filter( ‘get_shortlink’, ‘cyb_replace_domain_shortlink’ ); function cyb_replace_domain_shortlink( $shortlink ) { return str_replace( ‘mydomain.com’, ‘myalternatedomain.com’, $shortlink ); }
First, don’t echo your php, but assemble everything in a string, let’s say $titlestring. Next, make this string available for access by the javascript (the slug is the one you used to register the script): $params = array ( ‘titlestring’ => $titlestring, ); wp_localize_script (‘your-script-slug’, ‘IframeTitle’, $params); Finally, access the variable in the script: ‘<div … Read more
Thanks to @Samuel Elh I manage to get this done. I added this to my order-confirmation.php after I included config.php require (‘../wp-blog-header.php’); global $wpdb; global $current_user; get_currentuserinfo(); $skrivID = $current_user->ID; Then the insert query, I added the table I wanted the user ID stored in and used the variable $skrivID as value. $sql = mysqli_query($db_conn, … Read more