code that I can run, or a plug in to show what sql tables something pulls information from
code that I can run, or a plug in to show what sql tables something pulls information from
code that I can run, or a plug in to show what sql tables something pulls information from
How can I edit a php custom page template to work in other themes?
Add a top bar to a wordpress theme without editing the header.php file?
You have few issues with your code: You haven’t added php start code syntax properly at few places ( i.e. you should write <?php instead of <? ). You’ve to end endif loop with a Semicolon (;). You have to remove ““““ appearing at the end of the code. By implementing these fixes, your existing … Read more
It’s not the code in the form, but how you process the form’s data. I put this in my main ‘include’ file; it sanitizes all input data. The key is to never trust the form data without verifying it is valid. This code helps in that. // this sanitizes all gets/posts for security $_GET = … Read more
My quick and dirty solution was to nest 2 arrays and loop through them. You’ll need to hard-code your nth level URLs. This example singles out a specific custom post type. function yoast_seo_breadcrumb_append_link( $links ) { global $post; if ((is_singular(‘team-members’))) { $breadcrumbs[] = array( array( ‘url’ => site_url(‘/our-firm/’), ‘text’ => ‘Our Firm’ ), array( ‘url’ … Read more
You can use the get_the_excerpt filter to modify what’s printed by the_excerpt(): add_filter( ‘get_the_excerpt’, ‘wpse_367505_excerpt’ ); function wpse_367505_excerpt( $excerpt ) { return substr( $excerpt, 0, 50 ) . ‘ [Read More]’; } You can change the [Read More] text to whatever you’d like. Add this code to your theme’s functions.php file, and it should automatically … Read more
Try below code to delete the post_meta by a specific value of the specialized data: $args = array( ‘post_type’ => ‘post’, ‘meta_key’ => ‘any-meta-key’, ‘posts_per_page’ => -1 ); $query = new WP_Query( $args ); if($query->have_posts()){ while($query->have_posts()){ $query->the_post(); $get_ID = get_post_meta($post->ID, ‘any-meta-key’, true); // Change the id value that you want to delete if ( !empty($get_ID[‘id’]) … Read more
That is not an accepted SQL syntax per the MySQL manual. You must INSERT INTO MyGuests (firstname, lastname, email) VALUES (‘John’, ‘Doe’, ‘[email protected]’) But, and this is an expansion well beyond the scope of your question, if you have an array of this information, you could iterate over the whole thing to build your SQL … Read more
Your shortcode is getting the title, but you haven’t told it to return anything, so a small tweak should fix things: <?php function post_title_shortcode(){ return get_the_title(); } add_shortcode(‘post_title’,’post_title_shortcode’); ?> You could also continue setting get_the_title() to $variable and add a line to return $variable, but the above is the simplest, shortest option.