How to Redirect Url to homepage?
Instead of playing with .htaccess file I would recommend using WordPress “Redirection” plugin, it allows for redirection and also logs them.
Instead of playing with .htaccess file I would recommend using WordPress “Redirection” plugin, it allows for redirection and also logs them.
I don’t know any other way There is a much, much better way to do this – custom fields. As per these instructions in the custom fields docs, let’s say you use the field name iframe_url: <iframe src=”https://wordpress.stackexchange.com/questions/230707/<?php echo esc_url( get_post_meta( $post->ID,”iframe_url’, true ) ?>” width=”960″ height=”540″ frameborder=”0″ allowfullscreen=”allowfullscreen”></iframe> <?php the_content() ?> See how much … Read more
Yes, quick and dirty just create a new page template, set it as the home page. Then in your page template copy the signup code from wp-signup.php into the page template
There’s this built-in function for querying comments get_comments and here’s something that would help in your template: $comments = get_comments( array( ‘number’ => 10 ) ); if ( !empty( $comments ) ) { ?> <ul> <?php foreach ( $comments as $comment ) : ?> <li><?php echo sprintf( “<strong>%s</strong> on <a href=\”%s\”>%s</a> : \”%s\” — <a … Read more
Google code for displaying custom post items. Fetch all the custom post items in an array and then use a simple html of a drop down and put it in a for loop which will go through all the elements of custom post type. In the value attribute of drop down use the current array … Read more
This solution seems to be very close to what you need. But can’t say duplicated as you will need to do some coding to get 2nd email address. Check out. Adding a second email address to a completed order in WooCommerce To get email field from checkout try get_post_meta( $order_id, ‘_custom_field’, true ); now you … Read more
It comes down to needing to disable the search slug, by removing the search rewrite rules. I’ve created a plugin (also on the wp.org repo): https://github.com/GaryJones/disable-search-slug Here’s the main file: <?php /** * Disable Search Slug Plugin * * @package Gamajo\DisableSearchSlug * @author Gary Jones * @license GPL-2.0+ * @copyright 2016 Gamajo Tech * * … Read more
EDIT: I tried the following and it works in the theme “Storefront for woocommerce”(Though it needs additional styling). For some reason though, it does not work well with the twentyfifteen theme.(The submenu does not show.) add_filter( ‘wp_nav_menu_items’, ‘wc_products_on_nav_menu’); //filter to add the html add_action( ‘save_post_product’, ‘rebuild_custom_wc_nav_menu’); //action to regenerate the menu array anytime a product … Read more
Without knowing how you’re populating your combo box, here’s how I would do it: Use jQuery to capture the form selection: jQuery(‘#formElementID’).change(function () {//this captures dropdown menu change event //call js function and pass form value – in my case a post id fetchTenantWoContactInfo(jQuery(‘#formElementID’).val()); }); Use function to call ajax function to get post info … Read more
This is a simple PHP related question (and those are better asked at StackOverflow.com) and you can find if an index exists within a multi-dimensional array by iterating through it and matching. Something as: function wpse231889_has_user_voted( $user_id, $post_id ) { if ( !empty( ( $voters = get_post_meta( $post_id, ‘voter’ ) ) ) ) { foreach … Read more