Strip the + symbol from the_search_query

Personally, when I do things like this I use str_replace() [Link] Using your above example it would be implemented like so: <?php $string = the_search_query(); $res = str_replace(“+”, ” “, $string); echo $res; ?> That will replace any + with a space. Or if you want the &nbsp; use this: <?php $string = the_search_query(); $res … Read more

Insert functions-defined constant into get_tags code

I think this is what you are going for: $html .= “<a href=”https://wordpress.stackexchange.com/questions/49245/{$tag_link}” title=”{$tag->name} {$xyz_city}” class=”{$tag->slug}”>”; The {$tag->name} part is a way to insert a function or variable into a “double quoted” string definition. In the case of {$tag->name} it needs the {curly braces} to get the whole object->method thing to work. You can usually … Read more

Publishing videos and images from blog to facebook

That feature has been removed from Facebook: http://www.facebook.com/help/?faq=277347965620183 You could write a script that would log in as the user and post stuff, but that would be violating the Facebook terms of use. Or you could do it the other way around. Post the stuff on Facebook, and have your WordPress site grab the data … Read more

Custom Post Type and single-posttype template

I found solution. Big Thanks @Scribu Alternative to query_posts for main loop? Now works fine and no more 404 error. function wpse49295_alter_the_query( $request ) { $dummy_query = new WP_Query(); $dummy_query->parse_query( $request ); if ( $dummy_query->is_single() ) $request[‘post_type’] = ‘topic’; return $request; } add_filter( ‘request’, ‘wpse49295_alter_the_query’ );

URL Forwarding – wordpress links reverting back

The internal links are all hard-coded; you’ll have to do a search/replace in the database to fix them. This is a good script for search/replace that will go through your posts, widgets, everything: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Download the script, and upload it into your WordPress root directory (same path as wp-config.php). Surf to the script, then follow … Read more

Getting label name of extra user fields

Context: http://wordpress.org/extend/plugins/extra-user-fields/ Author URL: http://www.feweb.net/wordpressplugin_extrauserfields.htm Mentioned Functions: http://codex.wordpress.org/Function_Reference/the_author_meta http://codex.wordpress.org/Function_Reference/get_user_meta If you can already get the label BUT it comes with the input, and you are doing this in PHP, then do this: <?php # … # Your code which produces the input + label data into $data # … $document = new DOMDocument(); $document->loadHTML( $data … Read more

The loop: more posts than I want to fit on one page

You’re looking for one of two things: either paginate_links(), or the combination of next_posts_link() and previous_posts_link(). Both of these functions allow for “pagination”, or the ability to place links to more content than you’re displaying in a screenful. Google does this on the bottom of most pages, for example. Of the two methods I mentioned … Read more