Forum Replies Created

Viewing 15 replies - 16 through 30 (of 360 total)
  • Yes, of course, you can replace any file with a fresh one.

    If your problem is solved, may I suggest to mark this thread as [resolved]?

    @+

    S.

    He he… You did’nt misunderstood t31os_… 🙂 As I said, the title of the thread is really not clear.

    But in his second message : “I think what I’m really trying to do is put the image before the title and text”

    So I guess this is what he want to do… 🙂

    S.

    Oh… And I forgot…

    This function will display nothing if there is no image attached to a post…

    And if you want to wrap the picture in a div, it’s better to do it in the function itself to prevent an empty div if there is no image…

    Like this

    else {
    echo '<div class="my_picture_div">';
    echo wp_get_attachment_image()($photo, $size='large', $icon = false);
    echo '</div>';
    }

    @+

    S.

    Yes yes yes… Ok… So basically you want to put the image before the title and the text…. (the title of this thread is not clear about that :-))

    To do this, you should use a function to make a custom template tag and edit the loop in the template files (index.php/single.php/etc.)

    [1] Edit / create a function.php in your theme directory.

    [2] paste this function in function.php :

    function my_image_tag() {
    global $wpdb;
    global $post;
    $my_post_image = $wpdb->get_var("SELECT ID FROM $wpdb->posts where post_parent= $post->ID and post_type = 'attachment'");
    if ($my_post_image == 0) {
    echo "";
    }
    else {
    echo wp_get_attachment_image()($my_post_image, $size='large', $icon = false);
    }
    }

    This function retreive the first image attached to a post. Look at the last line and change $size='large' for the format you want to use (large/medium/thumbnail).

    [3] Save your function.php and upload it in your theme directory.

    [4] Now, you have a custom template tag you can use in your loop : <?php my_image_tag(); ?>

    [5] When you upload your first image in your post, DO NOT insert it in the post itself. It is “attached” to the post in the database. Juste upload the image and that’s all…

    [6] Then, in you loop, you go that way :

    <div class=”entry”>
    <?php my_image_tag(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_content(”); ?>
    </div>

    Of course, you can wrap my_image_tag in a div if you like to do so…

    It should do the trick. Edit the loop in all the template file where you want the image to be displayed : single.php, index.php, category.php…

    You can even make multiple functions (my_thumbnail_tag, my_medium_tag, etc) with different format… All you have to do is to edit the size in the function as I explained…

    Hope this help.

    @+

    S.

    Does the <img src=”example” /> is an image uploaded with the edit post in wordpress?

    S.

    From what I can tell, there is a </div> missing at the end of this sidebar to close the opening <div id="sidebar">

    Possible solution : Just add </div> at the end of the file, after the <?php endif; ?>… Should do the trick…

    Another option : replace the sidebar.php with a fresh one from your theme:

    http://ww.wp.xz.cn/extend/themes/blass2

    @+

    S.

    🙂

    The bottom line : do not use “paid” theme…. 🙂 .

    There is a support forum and a support theme for this theme on their site. Maybe you should start from there.

    S.

    Hi

    Probably a custom loop in the home.php file or in index.php file… Seems to me that your theme is displaying some “featured posts” or “featured category”…

    Since you paid for this theme, you should ask the developper about it.

    @+

    S.

    [1] Open the file “page.php” and “single.php” in your theme directory with a decent text editor.

    [2] Find this tag : <?php comments_template(); ?>

    [3] Delete this tag

    Then, all your “posts” and “pages” wont show the comment area.

    @+

    S.

    Forum: Plugins
    In reply to: “user” custom field?
    Thread Starter SimonJ

    (@simonj)

    Ok, I know, I’m a liitle bit late on this update… 🙂

    Just to make a little review about the solutions equalmark gave me three month ago.

    I tried the solution explained by Justin Tadlock here :

    http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields

    And it works perfectly, no plugin, very clean solution, well explained. It does exactly what I wish.

    Thanks a lot!

    @+

    S.

    Thread Starter SimonJ

    (@simonj)

    Nice nice nice…

    Here is what I did based on your suggestion :

    <?php
    $page_comment = get_query_var('cpage');
    if ($page_comment > 0) {
    echo 'comment page : '.$page_comment;
    }
    ?>

    For anyone searching this forum in the future, I was looking for a solution to add the page comment number in the <title> tag in my header, to avoid “double <title> tags” in search engine indexation…

    Another resolved issue! Thanks

    S.

    Juste make a copy of your index.php and rename it home.php…

    Then, edit this file (home.php) to make a loop with query_post…

    It should do the trick.

    S.

    Another very simple solution…

    Use the home.php template file with a query_post from the category you wish to display…

    🙂

    S.

    Hola

    [1] Learn how to make a wordpress page template

    [2] Make a page template with a query_post for a specific category

    [3] Use a page with this page template as an home page in your WP options.

    Look there for more information :

    http://ww.wp.xz.cn/support/topic/227151?replies=9
    http://ww.wp.xz.cn/support/topic/156208?replies=7

    @+

    S.

    Thread Starter SimonJ

    (@simonj)

    Nice! Thanks. It works.

    Cheers

    @+

    S.

Viewing 15 replies - 16 through 30 (of 360 total)