The code below is resulting in an error on a site in which there are ~ 1500 posts. It performs fine when post count is nominal, however, this heavy load is exposing the weakness of the code and I'd like to optimize it.
Interestingly, when I disable this menu and instead use the "Recent Posts" widget, the posts are drawn fine. So I'd pr...
I've tried to code a recent posts script for my custom WP theme, however, it occurs to me that since WP ships with a recent posts widget, ideally I should just be able to call that from within my sidebar.php script, passing it the "Number of posts to show" parameter.
Anyone know how to do this?
...
When calling WP's wp_list_pages() function, the script builds an unordered list menu and automatically ads a "current_page_item" class to the li element that we are currently viewing (if applicable).
I'm trying to get the "Recent Posts" widget to do the same, but I'm unsure how to do it, because I can't find a reference for this argumen...
I'd like to create a function that retrieves the post count for a given query. I don't want to use get_posts obviously as its way to expensive for this purpose. However, that's exactly what I'm having to use in absense of a get_post_count function.
My code is...
global $post;
$cat=get_cat_ID('mymenu');
$catHidden=get_cat_ID('hidden');
...
//checks that we are on current page and highlights tab as active if so
if(is_page($page_name)){
echo " <li><a href='$href' class='current_page_item'> $tabname</a></li>";
}
else {
}
if(is_single() && $singlelight=="this_one") {
echo " <li><a href='$href' class='current_page_item'> $tabname</a></li>"...
Hi,
I am developing site with wordpress and i am newbie for wordpress. WP adds p tag in editor while adding any post or pages. But i can't see the p tag in HTML mode. Can anyone suggest me what might be the problem.
Thanks in advance
...
Hi I've transfered my wordpress site to a new ftp server, but my home link doesn't work properly. When I click on it, it goes to http://123.456.78.8/mydomain.com and I get a page not found message. I've discovered it needs a / at the end to work.
Does anyone know a way to fix this before I put it on my live site?
Could it be a database ...
I can't seem to decode this base64 string which is in the footer of a wordpress theme. I want to be able to add more to the footer.
Any help appreciated, thanks!
<?php eval(stripslashes(gzinflate(base64_decode("pVNRa9swEH7OYP/h1kG7PbiGwfaQuM7D1tCwsY42UAaBINsXWyD7hKTO87/vSXUct3PZYPKLdN/5vrvvk5Yp8JrNkkL+glwJay+2J7lCYdBsT9Ik5nj6+lVIGh+e7...
I'm trying to write a short Wordpress JQuery for Wordpress comments that would allow users to toggle specific comments on and off. This is my first script, and I'm having a tough time.
In the "comment_options" DIV is a series of buttons that control the individual comments (reply, quote, edit, close, etc.). The close button is what I'm ...
Hello,
I want to create a website where the main pages will be served from CodeIgniter. I will use Wordpress in the /blog/ sub-directory to host the blog. Thats it! I want nothing else. Just to make sure that:
example.com/somepage/ calls a CI controller where as example.com/blog/some-post/ is handled by Wordpress.
I don't need any kin...
Hello everybody,
I'm using this codes for listing custom field values into drop-down list element on this category in Wordpress (screenshot is here what i'm point out).
So there are duplicate items on drop-down list and how i can delete duplicate entries on list?
Thanks in advance.
...
Hi Guys,
How would I go about displaying all of a site’s categories in checkboxes in my options panel?
I can get a dropdown select menu to work, I just have no idea how to implement checkboxes.
Code Here from Net Tuts: http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel/
http://pastie.org/885320...
Starting out with Wordpress plugin development - how does a plugin add a page to Wordpress that utilizes the current theme? For instance the plugin would create a page at this URL:
http://wordpress/plugin-name/start
This page should display a form using that utilizes the current theme. At the end of the day I'm going to replace the cur...
hi all , I'm writing a wordpress plugin that will execute a certain function when a user submits a comment. The only issue is I'm using the hook "comment_post" which works but if that comment gets stopped by akismet I'm still logging that comment but now my numbers are off from what's on the actual site. Is there a comment_approved type ...
it's can be apply not only to wordpress. But to all blog platform that can be installed into a server and shared host. so, What do you do via PHP coding or pluggin or any method to secure your installation ?
...
I try to us wp_enqueue_script to load my javascript, here is my code:
<?php wp_enqueue_script('slider','/wp-content/themes/less/js/slider.js',array('jquery'),'1.0'); ?>
It's not working, when I look into the source, it turns to be:
<script type='text/javascript' src='http://localhost/wp/wp-content/themes/less/js/slider.js?ver=2.9.2'&...
I have a wordpress-generated page where I need some posts (in a specific category) to have a 'Sign up' button. But when I add the conditioning code, found in this helpsheet, the page just shows this error:
'Parse error: syntax error, unexpected '<' in /home006/sub008/sc74101-DVGF/gadebold.dk/wp-content/themes/gadebold/single.php on line...
This is what i want to do:
I want /summary.php to include 5 latest posts (only the extract) from my blog, which lives in /wp.
Is there any way to include Wordpress in /summary.php and only print the html for these posts? (Maybe i should parse the rss?)
...
Hi there!
I'm trying to code my sidebar.php but it breaks and goes all the way down below the posts
PHP:
<!-- begin sidebar -->
<div id="menu">
<?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<label for="s">SEARCH</label>
<form id="searc...
I am using this code in wordpress to display different content when different pages are loaded. I have 5 pages on the site called Home, Bio, Work, Contact and Notes. The Notes page is being used as a blog. Here is the code I am using.
<?php if (is_page('contact')) { ?>
get in touch with me
...