Forum Replies Created

Viewing 15 replies - 1 through 15 (of 33 total)
  • Yeah well i guess we will have to work around it for now.

    Thread Starter Shadowz

    (@shadowz)

    Hey thanks

    Don’t know to much about php, but i get the jest of what you mean, if you could help me figure out how to put that code in my header where it displays the featured image that would be grateful.

    here the part of the code that displays my featured image

    if ( has_post_thumbnail( $post->ID )  &&
    
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    
    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    else : ?>
    
    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    
    <?php endif; ?>

    Thread Starter Shadowz

    (@shadowz)

    Anyone?

    oh yeah i believe i edited some parts of it myself, its fun changing what it does though.

    Yeah you can keep that theme, but if you make other themes later, it just makes sense to use the most relevant and up to date size if your going to totally change the way it looks, unless you want a specific already made design.

    Thread Starter Shadowz

    (@shadowz)

    Thanks and thats alright.

    I tried using that code, but its still doesn’t want to work.

    Its really weird there must be something else effecting that particular page type of page i don’t know about.

    Not sure what file effects the blog page though.

    well im a php noob aswell, but as for me this is what my line fo code for functions.php is Here

    and really that shouldn’t matter where it is in the <?php ?>

    As for the reference yeah that would work, but did you edit a copy of the original default functions.php and put your code into it, as if you were editing it. Then put that edited functions.php in the child theme folder. Then delete the functions.php in the default twentyten theme so there is only one functions.php which will be in the child theme folder.

    haha

    Your Welcome, if there is some parts of the code you don’t understand, ask me and i’ll see if i can tell you.

    Your Welcome

    Im not sure how you put the highlight there, but im pretty sure to get it so its one the blog page and not on the rest you will need to make a page template that has that highlight and, take out the highlight from where ever else you had it in the first place.

    So using a different page template for just the blog page and including that highlight in it will allow for it to only show in that page.
    this might help in the right direction

    Yeah if you don’t want to rebuild, id definitly look in the single.php and rebuild just that, so it does what you want.

    If you read the diffrent parts in the single.php you can kinda tell what does what and its a simple add or delete.

    In fact you might just be able to even just use mine and it should work.
    or at least use it to fix yours.

    here is my single.php code

    Yeah i had the very same problem, did an exact copy in to child theme folder for twenty ten, and its would not let me see wp-admin.

    So i just deleted everything and just put what i needed in <?php ?>

    But mine seems to be working fine now.

    However for you i was thinking about this,

    Maybe if you just put the whole functions.php file in the child theme folder with all the changes and deleted the default functions.php from the default twenty ten folder it might work like normal.

    just everytime you update wordpress you would need to delete the default functions.php

    Thread Starter Shadowz

    (@shadowz)

    bump!

    Thread Starter Shadowz

    (@shadowz)

    Can anyone help with this, I really dont get it. What adeptis said makes sense. It should be what affects it, but apparently it doesn’t. I even tried useing if (in_the_loop() )

    Its basically a normal page, and i switched my home page to a static page and made this normal page the blog page.

    I was wondering if theres a way to write it so
    “if it has a featured image then display it
    else default header.

    Instead of writing it so
    if its page then show featured image
    else default header.

    if i did it the first way it should work no matter what type of page it is, i just dont know how to write the code to say that.

    here the code i have in my header that target the featured image

    if ( ( is_singular() || in_the_loop() || is_page('7') ) &&
           has_post_thumbnail( $post->ID )  &&
    
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    
    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    else : ?>
    
    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    
    <?php endif; ?>

    Thanks

    Yeah i couldn’t believe it when i updated wordpress and everything was gone. So I’ve successfully got a child theme doing what i want now.

    i believe if you added <?php get_sidebar(); ?> at the bottom of Single.php. before <?php get_footer(); ?> it should show the side bar and do what you wanted to do. Also deleting the single.php would just make things worse you just need to edit it to work the way you want. But yeah i would say using twenty ten to build your own site is good, since its less likely to have bugs and built by wordpress as the latest version of wordpress.

    Thats what i used to make my own site and you can make it do anything you want just need to figure out what code to edit and add.

    Also make sure you learn how to use a child theme. Use a child theme when you edit twenty ten, because if you don’t you will lose all you changes when you update wordpress, i learned the hard way.

Viewing 15 replies - 1 through 15 (of 33 total)