Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #4869

    Hello! I want to put some text and an icon such as a date next to the comments and category links that are above the post text! Can you help me do this?

    #47852

    Hey,

    in single.php search for following code:

    <div class="entry-head">
    <span class="comments"><?php comments_popup_link(__('No Comments','habitat'), __('1 Comment','habitat'), __('% Comments','habitat')); ?></span>
    <span class="categories"><?php the_category(', '); echo $terms; ?></span>
    </div>

    and after

    <div class="entry-head">

    and before:

    </div>

    #47853

    Thanks! I want to insert a custom date, such as 28 december 2011 ..not the present date! How can i do this? But in every post the date might be change!

    #47854

    You can use the post meta function: http://codex.wordpress.org/Function_Reference/get_post_meta and custom fields for custom dates and custom data in general.

    #47855

    I put a date code ( <?php the_time(‘l, F jS, Y’) ?> ) under the <div class=”entry-head”> in the single.php and nothing happens! What’s wrong? Do i have to put it anywhere else?

    #47856

    <span class="date"><?php the_time('l, F jS, Y') ?></span>

    Will make the date appear on the post page itself when put where you did. To make it display on your homepage you can go in index.php and do the same (but the date is already on the left side.. so that’d be strange).

    To make it have some style you can add the following to the bottom of style.css

    .date{
    float:left;
    display:block;
    padding:0 17px;
    text-decoration: none;
    background:url("images/shared/icon_arrow.png") no-repeat 5px 3px scroll transparent;
    }

    #47857

    I want to delete the side date and put it in the entry head! But also i want to add a date next to the publish date that shows an expiration date of an event or a competition and must be a future date and different to the other posts!

    For further explanation: if you look my two (test) posts; they are announce competitions with prizes and someday the competition will end and i want to put an expiration date next to publish date . Also another parameter is that in every post the expiration date may be different! How can i do this? And also how can i put an icon such as the bubble in the comment?

    My site is : http://www.e-win.gr

    #47858

    I made it but i have some problems with the spaces between the category and the date icon and the place of the icon that is a little lower than the other icons! How can i fix it?

    #47859

    Hey,

    try following code (i.e. insert it in style.css):

    .entry-head .date {
    margin: -2px 0 0 10px;
    }

    #47860

    Thanks! I fix it! I want some little help… Now i want to put next to the date in the entry-head a future date that will be different from post to post and a sentence or word before the date such as : “Competition expires: 31-7-2011″ and in another post “Competition expires: 25-7-2011″ .. How can i do this?

    #47861

    Hey,

    you can use custom fields and the get_post_meta function: http://codex.wordpress.org/Function_Reference/get_post_meta to implement custom dates. You need to modify the portfolio options if you want to use custom fields with portfolio entries. To do this, open /theme_options/portfolio.php and find this code

    $args = array(
    'labels' => $labels,
    'public' => true,
    'show_ui' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug'=>$slugRule,'with_front'=>true),
    'query_var' => true,
    'show_in_nav_menus'=> false,
    'menu_position' => 5,
    'supports' => array('title','thumbnail','excerpt','editor','comments')
    );

    Change the supports to include custom fields like this:

    $args = array(
    'labels' => $labels,
    'public' => true,
    'show_ui' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug'=>$slugRule,'with_front'=>true),
    'query_var' => true,
    'show_in_nav_menus'=> false,
    'menu_position' => 5,
    'supports' => array('title','thumbnail','excerpt','editor','comments','custom-fields')
    );

    #47862

    Thanks Dude but you probably didn’t understand what i mean… I want to put next to the date that we made in the entry-head, custom date that i should write it because may be different from post to post…Thanks in advance!

    #47863

    Yes but post meta is post specific… you can enter another date for each post. Kriesi wrote a tutorial here: http://www.kriesi.at/archives/how-to-use-wordpress-custom-fields

    #47864

    I made it but as you can see the date is standard in the two posts but i want to be different to each post..How can i make this?I want to automatically take the value i put in the post custom field and preview it in each post. The key i put in the post should me the same in every post!

    #47865

    You can use what Dude gave you to assign a custom date to your post, with the custom field tutorial by Kriesi. I don’t see the problem?

    #47866

    I cannot do that! Is anybody available to help me? I put the custom field but i just want the “value” to be different in every post! How can i do this?

    #47867

    This modification is something which is beyond the scope of this support forum so we just can give you hints how to achieve what you want. Post meta allows you to save custom data (i.e. dates) for each post individually. I see no reason why you can’t use post meta….

    #47868

    I found the solution!

    #47869

    Glad you found it.

Viewing 19 posts - 1 through 19 (of 19 total)

The topic ‘How can i put next to the comment and category in the post some text and icon?’ is closed to new replies.