wordpress

Need to optimize this PHP script for "recent posts". Fatal error when post count is high...

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...

WordPress > Calling "Recent Posts" widget via script from custom theme

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? ...

Adding .current_page_item to WP "Recent Posts" widget

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...

WordPress get_post_count?

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'); ...

wordpress custom function for tabs creating duplicate tabs - simple php!

//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>"...

P tag is not displayed in html editor for Wordpress

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 ...

Wordpress transfer to new ftp. Help, Home link doesn't work?

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 ...

Decoding base64 string?

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...

JQuery & Wordpress - Hide multiple divs inside unique ID?

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 ...

Installing CodeIgniter on root and WordPress in sub-directory

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...

Duplicate Option Values on Drop-Down List Element

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. ...

List categories with checkbox in Wordpress Options?

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...

Wordpress plugin - add a new page

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...

trying to find the comment hook I need for wordpress?

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 ...

How do we protect our Wordpress from hacker ?

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 ? ...

WordPress Problem with wp_enqueue_script

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'&...

Wordpress category if-condition not working

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...

How can I include Wordpress posts in a custom PHP file?

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?) ...

Problem with CSS on Wordpress

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...

wordpress conditional statements

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 ...