What is the best practice to localize content? (Geographic not langauge)
I guess this thread will steal you more than a day. After reading through it and all the code it contains, you’ll be more than happy… or maybe just confused 😉
I guess this thread will steal you more than a day. After reading through it and all the code it contains, you’ll be more than happy… or maybe just confused 😉
You can do that by using this nice little function: function is_page_or_child_of($slug){ global $post; if (empty($slug)) return false; //is it the page? if ($post->post_name = $slug) return true; //check the children $page = get_page_by_path($slug); $children = get_pages(‘child_of=”.$page->ID.”&sort_column=post_date&sort_order=desc’); foreach ($children as $sub){ if ($post->ID == $sub->ID){ return true; } } return false; } and instead of … Read more
If you did not set an explicit excerpt for your post in the post editor, WordPress by default calls wp_trim_excerpt() to auto-generate an excerpt. This function throws out all HTML tags to make life simple. the_content() does not do this when it splits your post on a <!–more–> tag. If you don’t want this default … Read more
I don’t have hands-on experience with such use case, but my first suggestion would be to heck out plugins tagged wiki in official repository.
If content displays within WordPress itself when you are logged into the dashboard but does not display on the front end of your site it is almost always a theme problem. If you have access to server logs, such as error logs in cPanel, you can see what errors are being thrown up. The easy … Read more
Try the Search and Replace plugin: http://wordpress.org/extend/plugins/search-and-replace/ This searches for strings and will allow you to search for every instance of video-x-player, using a regex for the number. If you don’t want to use regex searching on video- will bring up every instance that is already in your database. If you intend to keep using … Read more
This belongs to stackoverflow. Here’s a solution anyway: $content = preg_replace_callback(‘/\%replaceContent:{(.*?)}\%/’, ‘do_replacements’, $content); function do_replacements($matches){ $type = $matches[1]; // here’s your {type} $replacement = “…replacement for {$type}”; return $replacement; }
You can use the in_category function to test if the current post in the loop is in the specific category you want to display full content for. For example if ( in_category( ‘my_category’) ) : the_content(); else : the_excerpt(); endif; For more information on the in_category function see the WordPress codex at: http://codex.wordpress.org/Function_Reference/in_category
Shortcode do have encapsulation. Read more about that here: http://codex.wordpress.org/Shortcode_API
Using custom post types for this seems like a bad approach. Instead, create a simple option page in the admin using add_options_page, displayed in the menu under “Settings”, for example. Lay out some input fields for each piece of data you want to save. You can use the options API to read and write each … Read more