• Resolved Smarca

    (@silviomc)


    Sorry for the English,
    then I put the permalinks some images no longer appear when I look at the way was thus:

    Correct: …/wordpress3/wp-content/themes/mytheme/images/post_not_imagem.jpg

    The error with permalinks: …/wordpress3/category/highlights/wp-content/themes/mytheme/images/post_not_imagem.jpg

    I’m using this function to display the images:

    function the_thumb($size = "medium", $add = ""){
    global $wpdb, $post;
    $thumb = $wpdb->get_row("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_parent = {$post->ID} AND post_mime_type LIKE 'image%' ORDER BY menu_order");
    if(!empty($thumb)){
    $image = image_downsize($thumb->ID, $size);
       print "<img src='{$image[0]}' alt='{$post_title}' {$add} />";
     }
     else {
       print "<img src='wp-content/themes/mytheme/images/post_not_imagem.jpg' alt='{$post_title}' {$add} />";
     }
    }

    How can I solve this problem? with the permalinks are coming in the url …/category/highlights/ causing this error.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hmm, without time to look more closely at your function I cannot say if that would even work!

    However, if you want to add any images to a post use the “add image” button across the top of the main text box on the post edit page in the admin panel.

    By using this WordPress will do all the hard work for you – it will upload the image and store it in the database, accessible under the ‘media’ section in the admin panel where you can easily edit the image and it’s properties.

    Once you’ve selected and uploaded your image you have to set the properties for it – such as title, alt-text, position and image size. Then click ‘Insert into post’ and WordPress will automatically add the necessary code to the post for you, it will also automatically associate the image and post on the database side too!

    hth

    Thread Starter Smarca

    (@silviomc)

    Thank you for listening, I managed to solve in another way here. I removed the alt = ‘($ post_title)’ and it worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘help permalinks’ is closed to new replies.