Viewing 15 replies - 1 through 15 (of 20 total)
  • Txanny

    (@txanny)

    By now the date and the posts format is hardcoded in the plugin. If you need to remove the date, you have to edit the plugin file and comment this lines:

    echo '<span class="sideposts_date">';
    	the_date();
    	echo ' | ';
    	the_time();
    echo '</span>';

    These are lines 236 to 240 (For 1.4.2 version). Will consider this for a next version, but don’t want to complicate the plugin with lots of options.

    Thread Starter bluebird2

    (@bluebird2)

    Thanks.

    Txanny

    (@txanny)

    Just have to remember: If you update the polugin to a newest release, you will lose this changes.

    Thread Starter bluebird2

    (@bluebird2)

    What lines should I comment out to remove “Read full post Β»” from the sidebar?
    I think this is not necessary since the title of the post is already a link.

    Thread Starter bluebird2

    (@bluebird2)

    Never mind. I found it. I wish these features had an option page, or check-mark options within the widget.

    Thanks for all the help.

    Txanny

    (@txanny)

    About this. The development version (to be released as 1.5) now includes a filter for the date called ‘sideposts_date’.

    To remove the date, just write a filter like this:

    function my_sideposts_date( $date ) {
        return '';
    }
    add_filter('sideposts_date', 'my_sideposts_date');

    Of course, I recommend not to write this on the plugin’s file, as it will be lost when updating.

    Thread Starter bluebird2

    (@bluebird2)

    Excuse my lack of PHP knowledge, but where should I place this code?

    Txanny

    (@txanny)

    Normally I set this in my functions.php file in the themes folder. Or just as a personal plugin with all my custom filters πŸ˜‰

    To create a plugin to hold this is really simple, here the file:

    <?php
    /*
    Plugin Name:	My Custom Filters
    Plugin URI:	http://alkivia.org
    Description:	Just a plugin to hold my personal custom filters.
    Version:	1.0
    Author:		Txanny
    Author URI:	http://alkivia.org
    */
    
    function my_sideposts_date( $date ) {
        return '';
    }
    add_filter('sideposts_date', 'my_sideposts_date');
    ?>

    Just call the file how you want (I call it my-filters.php) and set it in the plugins folder. Activate it as a normal plugin.

    With filters you have not to worry, if you deactivate the SidePosts plugin, this filter will no run, so you will broke nothing on your site πŸ˜‰

    Thread Starter bluebird2

    (@bluebird2)

    Thanks. It worked perfectly.

    Would you tell me what I should add there to remove RSS and “Read the full post” links? All I need is the title and the excerpt.

    Hi!
    I am in the same situation than bluebird2. I would like to remove the “Read full post” and the RSS icon from the widget. Actually I would like to keep only the title of the post and the thumbnail. How can I remove the excerpt? Thank you.

    The plugin is amazing, thank you so much!

    Hello,
    I was able to achieve this by making some small edits to the widgets.php file. Bear in mind that I am no php guru, so proceed at your own risk:

    I commented out lines 151 and 152 to get ride of the date.

    $date_string = '<span class="sideposts_date">'. mysql2date(get_option('date_format'), $post->post_date) . ' | ' . get_the_time() .'</span>';
    					echo '<br />' . apply_filters($this->ID . '_date',  $date_string);

    To get rid of the READ MORE link, I changed line 158 from this

    the_content('<p>' . __('Read more &raquo;', $this->ID) . '</p>');

    to this

    the_content('','true','');

    I hope this helps out. Someone may have a better suggestion, but this worked for me.

    @ Dev: This is a great plugin! It seriously helped me provide the needed functionality to a client, which is huge. So thank you very much!

    I think if you had the plugin generate classes and/or id’s for all of the key elements, that could make it easier for users to customize the appearance. For instance: span.sideposts_date is generated dynamically, so that makes it very easy for a user like me to get rid of that element if I don’t want it using CSS instead of messing with your code.

    span.sideposts_date {display:none}

    And it’s gone! Thanks again for the great plugin

    Txanny,
    I created a filters file to remove the date just as you suggested post #9, and I uploaded it to /public_html/wp-content/plugins/sideposts. But I’m not seeing a difference. Is there a step I missed?

    Since we’re talking about options, I’d love to see the date, archive link and RSS button become optional. In my current use of the plugin (on http://theagnonschool.org), none of that is needed right now and just creates clutter.

    (Oh, and can you also make the plugin do my dishes and answer my email?) πŸ˜‰

    Because what I’ve shown in that post is how to write a plugin to do it, you have to upload the file to the plugins folder, and activate it as a regular plugin. You’ve wrote a custom plugin, and it will act as a plugin: Have to be uploaded to plugins folder and activate it on plugins page.

    Ah, of course. Thank you Txanny.

    Hello Txanny

    Sorry to ask but could you kindly complete your “my custom filter” file so that your (great) plug-in doesn’t show the “readmore” link ?

    Can I change the name of the “Archives” link. It’s in English and my readers are French.

    Hope this is not too much to ask, thank you for your time & your nice work anyway

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin: SidePosts Widget] SidePosts and Date’ is closed to new replies.