Ajith K Ranatunga
Forum Replies Created
-
Forum: Plugins
In reply to: [Open Table Widget] "Time" dropdown issueFinally I found it is only available for paid version. So purchased it!
Forum: Hacks
In reply to: Multiple values to same meta keyyou can do this by serializing all the values and store in a single meta key, OR you can dynamically generate multiple meta keys and store as usual.
Forum: Themes and Templates
In reply to: [Zerif Lite] How do I disable site load animationglad that you could fixed your problem
Forum: Fixing WordPress
In reply to: can install plugins, add images , insert articles but not uploadsdon’t you get a directory name? if you get any name, create the directory with that name manually and try to install it.
Forum: Themes and Templates
In reply to: [Zerif Lite] How do I disable site load animationHi wiroxit,
you are welcome.
zerif-lite developers says there is an option ( checkbox ) to prevent loading pre-load image in theme options. But if you can’t find it, just open style.css in your theme folder and remove the code bellow. You should find this code around line number 1280
.preloader { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #fefefe; z-index: 99999; height: 100%; width: 100%; overflow: hidden !important; } .status { width: 200px; height: 200px; position: absolute; left: 50%; top: 50%; background-image: url(images/loading.gif); background-repeat: no-repeat; background-position: center; margin: -100px 0 0 -100px; }
Hope this helps you out.
Forum: Themes and Templates
In reply to: Show category postsif you want to show posts in a category on a page, you can follow the instructions bellow.
1. copy and past bellow code in the functions.php file in your theme.
<?php function unc_show_posts_by_category($attr){ /** wp query to get posts from specific category */ $cat_name = $attr['category_name']; $num_posts = $attr['num_posts']; $unc_query = new WP_Query( array('category_name' => $cat_name, 'posts_per_page' => $num_posts)); $results = ''; /** starting the loop */ if($unc_query->have_posts()): $results .= '<ul class="muaw-posts-by-category">'; while($unc_query->have_posts()){ $unc_query->the_post(); $results .= '<li>'; if(has_post_thumbnail()) { $results .= '<a href="' . get_the_permalink() . '" rel="bookmark">' . get_the_post_thumbnail(get_the_ID(), array(50, 50)) . get_the_title() . '</a>'; } else { $results .= '<a href="' . get_the_permalink() . '" rel="bookmark">' .get_the_title() . '</a>'; $results .= get_the_excerpt(); } $results .= '</li>'; } $results .= '</ul>'; endif; return $results; /* Re-set original Post Data */ wp_reset_postdata(); } // Add a shortcode add_shortcode('muaw_category_posts', 'unc_show_posts_by_category'); ?>
2. Add bellow shortcode with category name and number of posts.
[muaw_category_posts category_name="uncategorized" num_posts="5"]
That’s it. This code is used for one of my theme, so feel free to make necessary adjustments.
Forum: Themes and Templates
In reply to: [Zerif Lite] How do I disable site load animationUsually loading image is used to show it until the site is loaded. I don’t think that you can load the site even you remove the loading animation. But I can take a look if you could post the URL of your site.
Forum: Fixing WordPress
In reply to: can install plugins, add images , insert articles but not uploadsThis should be a file permission issue. Did you not check file permissions and try to fix any related issues ?
Forum: Reviews
In reply to: [Category Thumbnails] No option showing to add/select thumbnail.Thank you very much for this comment and plugin is great, thanks to plugin author too.
Forum: Fixing WordPress
In reply to: Updating posts with $wpdb->update() and wp_update_post()I also having the similar problem. When I try to change post status from “publish” to “draft” it duplicates the post and the new one is a “draft”. I need to change the status of the existing post instead.
Please advice me where I have been wrong or is there anyway I can do that.
Here I’m pasting the code I’ve used.
$my_post = array(); $my_post['ID'] = $id; $my_post['post_status'] = 'draft'; wp_update_post($my_post);
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
I have been spending hours on google to find a solution for this. Please help me if any one know this.