Generating embed code for users to share

Try following code. This will display embed code in the bottom of the page. <?php add_filter(‘the_content’,’my_custom_embed_code’); function my_custom_embed_code( $content ){ global $post; if ( ‘page’ == $post->post_type ) { $embed_code=””; $page_url = esc_url( get_permalink($post->ID ) ) ; $embed_code .= ‘<object data=”https://wordpress.stackexchange.com/questions/160604/.$page_url.” width=”100%” height=”500″><embed src=”https://wordpress.stackexchange.com/questions/160604/.$page_url.” width=”100%” height=”500″></embed> Error: Embedded data could not be displayed. Visit <a … Read more

checkbox function not working for dropdown menu

As per the wp_nav_menu() function the default classes are like below: <ul class=”menu”> <li><a href=”#”>Menu</a></li> <li> <a href=”#”>Menu</a> <ul class=”sub-menu”> <li><a href=”#”>SubMenu</a></li> <li><a href=”#”>SubMenu</a></li> </ul> </li> <li><a href=”#”>Menu</a></li> </ul> Note that, the .menu and .sub-menu. May be you are messing with the wrong class names, and some class conflicts.

WordPress HTML Helper

The short answer is that there isn’t one. WordPress templating consists mostly of raw PHP and Template Tags API. The API is more focused on outputting specific content, than producing specific HTML. As result the technique is pretty much unknown in WordPress development. It doesn’t mean that you can’t use one, but it’s just not … Read more