Give a function a unique ID

Just… call the function again – you only need to include it once! include ‘./path/to/lib.php’; echo_tweet_js(); // a little tweeting here … echo_tweet_js(); // and a little tweeting over here!

Screen Options WordPress WYSIWYG

The content box is in a <div> with an ID of #postdivrich so you can hide it using CSS. Probably the easiest thing to do is to add a settings option to an existing page so you can turn it off or on. The post below covers that in detail: http://wpengineer.com/2139/adding-settings-to-an-existing-page-using-the-settings-api/ After you have the … Read more

Make a table out of meta box

Each field in the meta box is being saved as post meta (a.k.a. custom fields). You can display the info per-field with the get_post_meta function, i.e.: <?php echo get_post_meta( $post->ID, ‘anime_anime_genre’, true ); ?> The parameter in the middle (anime_anime_genre) is each field ID specified in your code above. The reason “anime” appears twice is … Read more

Query is not work

I think the problem is in your transient set_transient( “7677recent_$my_paged”, $my_query, 60 * 60 ); This is currently refreshing every 1 hour you could try changing it to 3 or 5 mins for testins

Force resize for all video content

Without knowing more information – you can use CSS to set a max width to any element. iframe, object, embed { max-width:100%; } Rachel Baker mentioned Fitvids.JS in her WordCamp Chicago presentation last weekend. It is a Javascript plugin that writes specific code for the various video providers online. Try the CSS solution and fall … Read more

Comment Function

the function you posted is limited to 5 comments which means it should work, but anyway there is no need for a custom SQL query when you can use the native get_comments function function showLatestComments() { $comments = get_comments(array( ‘status’ => ‘approve’, ‘number’ => ‘5’ ) ); $output .= ‘<h2>Latest student perspectives <img src=”https://wordpress.stackexchange.com/wp-content/themes/blue-and-grey/images/hmepage-tri.png” class=”class3″ … Read more

Modifying Page-Links format

One easy way to do this is to alter the global variables related to paging after calling the_post() in your loop. global $post, $pages, $numpages, $multipage; while( have_posts() ) { the_post(); if( is_mobile() ) { $pages = array( $post->post_content ); $page = $numpages = 1; $multipage = false; } // … template the_content(); } Basically … Read more

Syntax for a function in order to get post’s title in JSON encoded response [closed]

You want to add the title to the response, not replace the response with the title. Like this: <?php function get_all_images($post_id=0, $size=”bigger”, $attributes=””) { $post_id = $_POST[‘post_id’]; if ($post_id<1) $postid = get_the_ID(); if ($images = get_children(array( ‘post_parent’ => $post_id, ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘orderby’ => ‘menu_order’, ‘post_mime_type’ => ‘image’,))) $title = get_the_title($post_id); $response=”<h2 … Read more