wordpress

Wordpress: Something like is_blog_index() when using a static front page?

In WordPress 3 I've set up a static front page (called "Home"). I need to add a condition in my common header that will return true when viewing the main blog page. The built-in function is_page('blog') doesn't work for this, is_front_page() doesn't either and is_home() returns true on Home as expected. I could have sworn WP already had...

PHP: How to put a variable in an array?

Just a quick newbie PHP syntax question. I have a variable, let's call it $tabs which always contains a string of numbers separated by commas, like so: 24,35,43,21 I also have a variable that's an array: $args = array('post_type' => 'page', 'post__in' => array(27,19,29), 'order' => 'ASC'); That's of course WordPress. What I need to ...

Full Magento / Wordpress integration

Can anyone offer any advice on the best way to fully integrate a wordpress blog into a magento store? I have seen many different approaches of this integration (lazzymonkeys, sonassi etc), but none seem to fully integrate the entire blog, i.e. posts, categories, archives, search etc. So far, I have created a module that is essentially ...

Wordpress PHP: List categories without links?

Hello, I am using wordpress 3.01, and would like to list a number of child categories within a parent in this format. Without links. { 'cat1' , 'cat2' } Is this possible? http://codex.wordpress.org/Template_Tags/wp_list_categories this call seems like the right one, but I can't figure out how to list them without turning off links Th...

Wordpress: getting latest post/image to display on an external (Posterous) site template

Hi there, I have a site currently built on Wordpress. I have a requirement to pull out the "latest post" in a category (magazine issue), to allow the latest issue to be displayed in the sidebar of a Posterous blog template, either in an iframe or by other means. What's the best way to achieve this? Shall I write a custom PHP page which...

PHP image grab when allow_url_fopen=off

I am using thesis theme on my wordpress blog. I am hosting my blog at byethost which has allow_url_fopen=Off and allow_url_include=Off In one of the function, code is trying to read an image url path. From what I understand, if fopen is ON, it will execute "if" case otherwise "else" case if ($thesis_design->image['fopen']) $imag...

How to alter PHP replace function?

add_filter('wp_list_categories', 'myCatNoBrk', 10, 1); function myCatNoBrk($OrgCat) { $CatNoBrk = preg_replace('/<br \/>/',',',$OrgCat); return $CatNoBrk; } Hello, this is part of a wordpress function that would replace html breaks with commas. How could I alter this to also remove and add 'x' around each element? ...

exclude the first letter of a sentence from get_the_content() wordpress function

hello! Anybody know how can I exclude only the first letter of a get_the_content() function in wordpress? could be a snippet like that, but it doesn't work! substr(strip_tags(get_the_content()), 1, get_the_content().length) thanks a lot in advance :) ...

Wordpress - Query if a custom post type has any posts - from outside the loop

I'm making a restaurant menu using custom post types for the different menu sections. I used the excellent Custom Post Types UI plugin and the Verve Meta Boxes plugin. I'm then flowing them out into separate loops with several segments of the below code: <?php $hotfood = get_posts( array('post_type' => 'hotfood', 'posts_per_page...

jQuery not showing Swedish characters correctly

Hi. I wrote a small snippet in jQuery to just put a search word into my searchbox in wordpress, then when clicked to disappear. <script type="text/javascript"> var $j = jQuery.noConflict(); $j(function(){ $j('#s').click(function() { $j(this).val(''); }); ...

Wordpress Custom Query displayed into 3 different DIVs

Hi guys, I'm working on a news slider based on the well-known jQuery Tool Scrollable. On the header of my site, I would like to create a new Query (only sticky posts with a maximum of 12 posts), display like this : <!-- 1-4 --> <div> <div>POST 1</div> <div>POST 2</div> <div>POST 3</div> <div>POST 4</div> </div> <!-- 5-8 --...

wordpress PO MO question

I have a wordpress site, that is using internationalization, and I would like to change a string of content, but I don't know where to begin. I have the Swedish language files in my site which generates the following result for pagination ← Äldre inlägg and I would like to change this to something else Visa senare. Which files need to ...

How to do pagination on a Wordpress "Page"

I have seen this function call get_query_var('paged') work in other places my page is /news/page/2 But get_query_var('paged') is allways returning 0. What gives? Thanks! ...

How to confirm change of email in Wordpress

I need to confirm change of user email adress in Wordpress. For me it's a big problem in security of site. I searched for a while but haven't found anything. Can someone help ? ...

How much does a wordpress developer working hour cost?

I'm trying to workout a budget for a project that requires wordpress, and I need to know what Wordpress developers charge by the hour. The solution would require to make a modification to an existing Wordpress installation to make adding of document references according to categories, which would be searchable. ...

How to get an array from a saved custom field

I save my array of integers in a custom fields with the function: update_post_meta($post->ID, "images", array(1, 2, 50)); How can I load this array now? I try to use something like this, but without any luck: global $post; $custom = get_post_custom($post->ID); $myarray = $custom["images"][0]; echo $custom["images"]; It returns som...

How to genenerate 24 random numbers between 1 and 24 in PHP?

For this Wordpress site, I need to generate 24 variables each of which contains a number between 1 and 24. The problem is that two variables cannot have the same value. So I basically need to generate 24 variables each of which contains a number between 1 and 24. Here's the code that I am using to generate a random number. $mirza = ran...

Wordpress - SQL query on two custom fields issue

I've got this query so far: if(!empty($_SESSION['s_property_region'])) { $sqlWHERE .= " AND $wpdb->postmeta.meta_key = 'property_region' AND $wpdb->postmeta.meta_value = '".$_SESSION['s_property_region']."'"; } if(!empty($_SESSION['s_property_bedrooms'])) { $sqlWHERE .= " AND $wpdb->postmeta.meta_key = 'property_bedrooms' AND $...

How do I Alter this wordpress php to output into an array?

<?php $parent_cat = 57; $child_cats = get_categories('child_of='.$parent_cat); if($child_cats) : echo '{ '; foreach($child_cats as $cat) { echo $sep . $cat->cat_name; $sep = ', '; } echo ' }'; endif; ?> The above code outputs a number of categorys in this format: A Cut Above,A20Labs,AMCH, how would I add ' ' aroun...

Removing google adsense breaks website - Wordpress custom_functions.php

I added following code in wordpress custom_function.php file a while ago to display google adsense. Now I want to remove the code but my website breaks when I comment out the following code. I don't understand why. Please provide your input on this. function sidebar_ads() { ?> <script type="text/javascript"><!-- google_ad_client = "pub-...