URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
You could use <a href=”https://wordpress.stackexchange.com/questions/74874/<?php echo site_url(“/images/buy-button.gif” ); ?>” alt=””>
You could use <a href=”https://wordpress.stackexchange.com/questions/74874/<?php echo site_url(“/images/buy-button.gif” ); ?>” alt=””>
ok, I figured it out myself. instead of using the CSS class (as I cannot figure out how to filter it), I decided to use the description instead. under the lines with $attributes I have added this line: $description = ! empty( $item->description ) ? esc_attr( $item->description ) : ”; And then I added that … Read more
/** * Define a new function that uses $args and wp_parse_args() */ function explain_parse_args( $args ) { $defaults = array ( ‘text’ => ‘wp_parse_args() merges $args into $defaults’, ‘before’ => “”, ‘after’ => ” \n”, ‘echo’ => TRUE ); // Parse incomming $args into an array and merge it with $defaults $args = wp_parse_args( $args, … Read more
With the Apache web server, one would create a rule in the .htaccess file. I believe the equivalent in IIS7 is the web.config file. This page appears to point in the right direction. I would be more specific about where to place the file or how to construct the rule, but I have no experience … Read more
If it where me id store each question as a ‘question’ type meta as a stored array. WordPress automatically serializes your array before storing it. So then when you use get_post_meta($post_id, ‘question’) it will return an array of serialized strings.(I think, Im pretty sure it wont unserialize it for you if there are more than … Read more
You don’t need to use query_posts function. It could be done without it. Use setup_postdata function to set up global post data. $sql = ” SELECT p.* FROM orders_items oi INNER JOIN products pr ON pr.`post_id` = oi.`product_id` INNER JOIN posts p ON p.`ID` = pr.`post_id` AND p.`post_type` = ‘product’ GROUP BY oi.`product_id` ORDER BY … Read more
Without knowing which theme you use or which plugin we cannot really tell you much. Even if we knew what theme it is it would be hard as we may not know how the theme is coded. What I can tell you is that the alt text on links is definitely not in any of … Read more
If you register the post type with public set to true, the titles will be included automatically. You shouldn’t have to do anything to make this happen. Something as simple as this from the Codex: function codex_custom_init() { $args = array( ‘public’ => true, ‘label’ => ‘Books’ ); register_post_type( ‘book’, $args ); } add_action( ‘init’, … Read more
If you look in your theme’s comments.php file, you should see a call to wp_list_comments. If that has a callback parameter– something like this array( ‘callback’ => ‘twentyeleven_comment’ )— then your theme has its own comment display function. Find that function. It is probably in function.php but no promises. If not, you need to make … Read more
Looks like you’re after Random Post Link. For completeness here’s some code (the plug-in is a little more involved as it stores as a cookie previous random posts, so they don’t twice). (The following is based on the above plug-in by Scribu) //Create random url – use this where you want the link to be … Read more