How can i call from custom fields to the category editor?

You are saving your extra fields to the *_options table so you need to pull them back out of that table. You can copy and cobble together bits of the existing code to do that. if ( is_category() ) { $current_cat = get_query_var(‘cat’); } $tag_extra_fields = get_option(MY_CATEGORY_FIELDS); // var_dump($tag_extra_fields); // debug if (isset($tag_extra_fields[$current_cat])) { var_dump($tag_extra_fields[$current_cat]); … Read more

WordPress video end function [duplicate]

You can track the state of the youtube video, do you have the link to the youtube video? Use this youtube API function to get the result, and if it hits you back with a “0” you can initiate the alert(); function player.getPlayerState():Number Returns the state of the player. Possible values are unstarted (-1), ended … Read more

WordPress plugin not eching popular posts

one possibility is: public function popularPosts($num) { global $post; $args = array( ‘orderby’ => ‘comment_count’, ‘order’ => ‘DESC’ ); $posts = get_posts( $args ); $count = 0; foreach ($posts as $post): if($post->comment_count != 0 ){ $count++; } endforeach; if ( $count > 0 ): foreach( $posts as $post ) : setup_postdata($post); if($post->comment_count != 0 ){ … Read more

Sanitizing a custom query’s clauses

I would suggest to think in this way: if I can not sanitize whole query (as you can not, what does sanitized mean? Is DELETE or DROP malicious or wanted query? Your plugin would have to be able to determinate the intended purpose of each query ant it is unreachable.), you can predict it’s content. … Read more

Custom permalink to make a page respond properly

I found the answer by tracing through the wordpress code, wasn’t easy, this code is really a complete mess but hell, i made it through… The solution comes in 3 different parts: Register your custom post type / Custom permalink structure Generate your custom rules / Overwrite existing rules Overide the redirect canonical filter to … Read more

How to make a list of posts displaying them 5 by 5 with a “next posts” link?

I found the actual answer in a stackoverflow question. Quoted from the answer: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 10, ‘paged’ => $paged ); $wp_query = new WP_Query($args); while ( have_posts() ) : the_post(); ?> <h2><?php the_title() ?></h2> <?php endwhile; ?> <!– then the pagination … Read more

Twenty Eleven theme-options error

You will need to login over FTP, or via some file manager supplied by your host (cPanel and Plesk have built in FTP-like file managers), and replace that file with a clean one. After which, don’t use the file editor. It is dangerous, like working on an airplane while it is in the air.