Closing WP_LINK_PAGES DIV ID w/After Argmuent

First, declare the after arg at the beginning of your code: $args[‘before’] = ‘<div id=”link_wrap”>’; $args[‘after’] = ‘</div>’; When there is a next page, the arg is overwritten, so you’ll have to add the closing tag at the end: if ($page<$numpages) # there is a next page $args[‘after’] = ‘ ‘. _wp_link_page($page+1) . $args[‘link_before’] . … Read more

WP_LINK_PAGES Generating Unnecessary Tag

the </p> is just a browser artefact to compensate for a missing </span>; your code is missing . $args[‘link_after’] in two locations; the corrected code: // WP_LINK_PAGES: Add prev and next links to a numbered link list add_filter(‘wp_link_pages_args’, ‘wp_link_pages_args_prevnext_add’); function wp_link_pages_args_prevnext_add($args) { global $page, $numpages, $more, $pagenow; $args[‘before’] = ‘<div id=”link_wrap”>’; $args[‘after’] = ‘</div>’; $args[‘link_before’] … Read more

Displaying Overlay images over thumbnail of category type?

There are many ways to do what you want to do. Here is a tutorial that will show you how to get it done. Just alter the css to fit your needs http://webdesignandsuch.com/create-overlay-on-image-hover-jquery-css3/ as far as linking. You can use WordPress code for that. Such as <a href=”https://wordpress.stackexchange.com/questions/81732/<?php the_permalink(); ?>”><img src=”your image with overlay”></a>

Post Views Code Hacks

// Post views function getPostViews($postID){ $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘0’); return “0 View”; } if ($count == ‘1’) { return $count.’ View’; } else { $count = number_format((int)$count); return $count.’ Views’; } } function setPostViews($postID) { $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ $count … Read more

I don’t have comments.php… how do I customize my comment fields

A little late, but you could also add the following to your theme’s functions.php file: /** Comment Form Function Defaults */ add_filter(‘comment_form_defaults’,’my_comment_defaults’); function my_comment_defaults($defaults) { global $user_identity, $id; if ( isset($post_id) ) $id = $post_id; else $post_id = $id; $commenter = wp_get_current_commenter(); $req = get_option( ‘require_name_email’ ); $aria_req = ( $req ? ” aria-required=’true'” : … Read more

Custom Fields Not Showing

You have number_format wrong. The second parameter should be a number and you have a string– a comma. What you want is something like echo number_format($price,2,”,”,”,”);

Shortcode displaying at the top of the page [duplicate]

You use the function the_exerpt(), replace this with get_the_excerpt(). I don’t know for sure, but you might need to use apply_filters(‘the_excerpt’, get_the_excerpt()) to maintain the formatting in wich the_excerpt() is returned. Try to use get_comment_reply_link instead of comments_popup_link. both functions the_excerpt() and comment_popup_link() won’t return values, but print it, wich cause te content to be … Read more

Limit the number of child pages

This is how I solved it: <?php /* Template Name: home */ get_header(); ?> <?php $counter = 1 ?> <div class=”row-fluid”> <?php $args = array( ‘child_of’ => 4, ‘parent’ => 0, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’ ); $childrens = query_posts(‘showposts=3&post_parent=4&post_type=page&orderby=menu_order&order=DESC’); foreach ( $childrens as $children ) : query_posts(‘showposts=3&post_parent=”.$children->ID.”&post_type=page&orderby=menu_order&order=DESC’); if ( have_posts ) : while … Read more

Adding a ‘style=’ bit to image_send_to_editor output

I can’t find the proper hook, but there is alternative solution: to add style=”float:right” to all images in content, which have class=”alignright”: add_filter(‘the_content’, ‘my_add_image_float_right’); function my_add_image_float_right($content) { $pattern = ‘@(<img.+)(alignright)(.*)(/>)@Ui’; $replacement=”$1$2$3 style=”float:right” />”; $content = preg_replace($pattern, $replacement, $content); return $content; }