How to string lines from the_content() hook in WordPress?

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

How to show recent comments on WordPress homepage with post title?

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\” &mdash; <a … Read more

Update wordpress menu with woocommerce products

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

Combo box populating a DIV using ajax/jquery

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