WordPress – how to replace with string on the_content() in single.php
what version are you using? in wp 3.0 above you can use <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, twentyten’ ) ); ?>
what version are you using? in wp 3.0 above you can use <?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, twentyten’ ) ); ?>
Perhaps try: echo do_shortcode(‘[nggallery id=’ . $meta . ‘]’);
Sure – the method of cropping/ resizing the thumbnail is normally determined in the templates functions.php file. Look for something along the lines of: <?php set_post_thumbnail_size( $width, $height, $crop ); ?> The third parameter is the method of cropping, a boolean. Set it to true and it will crop the image exactly, set it to … Read more
Local web server is a must, it’s pretty much generic web server stack (Apache, MySQL, PHP plus other bits) only running on your local computer. Deployment depends on how you manage your code: just resides on your computer – you will need to sync it to remote server in some way (FTP, SFTP, etc), any … Read more
The functions the_permalink() and the_title() print their results by default. Use get_permalink() and get_the_title() instead: while($query->have_posts()){ $query->the_post(); $url = get_permalink(); $keyword = get_the_title(); Print(‘<p>’ . $url . ‘{’ . $keyword . ‘}’ . ‘</p><br>’); }
The global $wp_query object is not what you are looking for by the time you get to single.php. Instead use global $wp object. Try changing your code to this: global $wp; if (array_key_exists(‘myvar’, $wp->query_vars) && isset($wp->query_vars[‘myvar’])){ echo ‘custom variable recognized’; } print_r($wp->query_vars);
although @roikles offers a way to do it, I don’t think it is very flexible as you will have to go back in the code when you want to add a new category. Another way of doing it can be to add the image of the subcategory as the description of the subcategory. To be … Read more
I would make a plugin out of the code that you are using to pull the XML. I’ve done this before for a client that was using a calendaring system that was a set of PHP files. I wrapped the calls to the calendar files in a plugin, and just called what I needed to … Read more
If I were doing it this is how I’d do it: I would be to use a plugin such as cFormsII (free), Gravity Forms (Commercial), or several others to store the data in the database. Both the plugins I mentioned allow you to export the data which is great for a guest list. For the … Read more
I’d suggest not using $query_string to simplify things. If you’re using an array, stick with the array form for the query variables: global $wp; $paged = ((int)get_query_var(‘paged’)) ? (int)get_query_var(‘paged’) : 1; $s_array = array( ‘post_type’ => ‘blog’, ‘caller_get_posts’ => 1, ‘paged’ => $paged, ‘meta_query’ => array( array( ‘key’ => ‘votes_percent’, ‘value’ => ’50’, ‘compare’ => … Read more