Forum Replies Created

Viewing 15 replies - 16 through 30 (of 42 total)
  • Forum: Fixing WordPress
    In reply to: Basic CSS question
    Thread Starter virgild

    (@virgild)

    Wow it works!!! Php is so flexible ?? Thanks!

    Forum: Fixing WordPress
    In reply to: Basic CSS question
    Thread Starter virgild

    (@virgild)

    ok I tested it an I get

    Parse error: syntax error, unexpected ‘%’

    on this line
    <div class="block_two <?php if(%counter == 3) { echo ' last'; $counter=0; } ; $counter++; ?>">

    Forum: Fixing WordPress
    In reply to: Basic CSS question
    Thread Starter virgild

    (@virgild)

    Oh I didn’t know about that. You mean like how I would style the first post differently?

    Thread Starter virgild

    (@virgild)

    still can’t figure it out ?? please help meh..

    Thread Starter virgild

    (@virgild)

    ok I’ll provide one soon I finish it. thanks

    Thread Starter virgild

    (@virgild)

    Thank you for teaching me that! Php seems pretty complex but it’s worth learning it! ??

    Thread Starter virgild

    (@virgild)

    Thank you for the new code! To be honest I don’t understand most of it ?? I think I have to learn some basic php. May I ask one question tho?

    I don’t understand why you globalised the variables. I don’t have that code but the theme works. What does that do?

    Thread Starter virgild

    (@virgild)

    thanks! I’ll give it a go.

    Thread Starter virgild

    (@virgild)

    Oh sorry, I was referring to the new post thumbnail feature in wordpress 2.9.1

    Thread Starter virgild

    (@virgild)

    I tried this.. I think I’m getting closer.. or going adrift lol

    <?php if ($_image1=="") {?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $theme_image1; ?>&h=100&w=293&zc=1" alt="" width="293" height="100" /></a>
    <?php else : ?>
    none
    <?php endif; ?>

    but it doesn’t work ??

    Thread Starter virgild

    (@virgild)

    Thank you so much for trying to help me! I shouldn’t probably play with php until I learn the basics.. but it’s fun! ??

    here is the page template on which I have the codes. I’m trying to make my own theme with theme options.

    https://wordpress.pastebin.ca/1771031

    I have 3 text blocks on the bottom page similar to the ones in this theme

    https://www.curtziegler.com/sitedemo/portfolio/

    just that I have images under the titles.. and when there is no image uploaded I get that broken image icon..

    Thread Starter virgild

    (@virgild)

    Sorry for not explaining. You’re not rude at all! I’m not even sure what I’m really doing but it works.

    The code is for a custom theme option I’m using to display images in my blog.

    It calls this function.

    array(  "name" => "Box image",
    	"desc" => "Enter image path for the text box",
    	"id" => $shortname."_image2",
    	"std" => "",
    	"type" => "text"),

    so I’m placing this

    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $theme_image2; ?>&h=100&w=293&zc=1" alt="" width="293" height="100" /></a>

    in my page template where I want the image to appear. But when I don;t upload an image I get the broken image icon. so I’m tryin to use a sort of

    <?php else: ?>
    <?php endif; ?>

    php code to display nothing if there is no image path but I don;t know how to implement that.. I’m very new to php.

    Thread Starter virgild

    (@virgild)

    Thanks for the code! Would this be correct?

    <a href="<?php the_permalink() ?>" rel="bookmark">
    <?php $i = echo $theme_image2; ?>&h=100&w=293&zc=1" alt="" width="293" height="100" />
    <?php if( $i ) : ?>
    <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $theme_image2; ?>&h=100&w=293&zc=1" alt="" width="293" height="100" /></a>

    The original code without conditions is

    <a href="<?php the_permalink() ?>" rel="bookmark"><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $theme_image2; ?>&h=100&w=293&zc=1" alt="" width="293" height="100" /></a>

    Thread Starter virgild

    (@virgild)

    Yup that’s what I had in mind.. but I was thinking instead of using actual pages, I’ll try to develop theme options for each block.. like you would go in theme settings and write whatever for each block and have it appear in the homepage. I know it’s farfetched considering my lack of WP experience. I guess I;m asking for some kind of tutorial or step to learn how to do this. Please help me if you can with any kind of advice.

    Thread Starter virgild

    (@virgild)

    Hmm, I added it but nothing happened.

    This is my homepage.php

    <?php
    /*
    Template Name: Homepage
    */
    
    get_header(); ?>
    
    <div id="content">
    <div id="leftcolumn">
    
    <div class="posthome">
    
    <?php query_posts('posts_per_page=1'); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_content(__('Read more'));?>
    <?php endwhile; else: ?>
    
    <?php endif; ?>
    
    <?php
    $args=array(
    'post_type' => 'post',
    'post_status' => 'publish',
    'posts_per_page' => 6,
    'caller_get_posts'=> 1
    );
    $my_query = null;
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
    echo '<div id="titlebox"><div class="title">Recent Posts</div></div>';
    while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <div class="headingbox">
    <h3 class="smalltext">
    " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h3>
    <h4 class="floatright"><?php the_time('F j, Y'); ?> | " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">Read All</h4></div>
    
    <?php the_excerpt();?>
    
    <hr />
    
    <?php
    endwhile;
    }
    wp_reset_query(); // Restore global post data stomped by the_post().
    ?>
    
    <div class="postclear"></div>
    <div class="postbottomhome"></div>
    
    </div><!-- end #post-->
    
    </div>
    
    </div><!-- end #content-->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 15 replies - 16 through 30 (of 42 total)