cron: you can’t split multiple lines command

12 May 2015 No comments

Remember: you can’t split multiple lines command inside cron like you do in shell with the \

 

 

SOURCE:

https://www.pantz.org/software/cron/croninfo.html
http://www.alleft.com/sysadmin/common-cron-mistakes/

Categories: Linux

iNove theme: show “Last edited by” in posts

13 December 2013 No comments
Last edited by on 13 December 2013 at 13:05

If you want the change in single posts, edit single.php, if you want the change in Home Page, edit index.php.

 

In single.php after

[cce_php]        <div class="info">
            <span class="date"><?php the_time(__('F jS, Y', 'inove')) ?></span>
            <?php if ($options['author']) : ?><span class="author"><?php the_author_posts_link(); ?></span><?php endif; ?>
            <?php edit_post_link(__('Edit', 'inove'), '<span class="editpost">', '</span>'); ?>
            <?php if ($comments || comments_open()) : ?>
                <span class="addcomment"><a href="#respond"><?php _e('Leave a comment', 'inove'); ?></a></span>
                <span class="comments"><a href="#comments"><?php _e('Go to comments', 'inove'); ?></a></span>
            <?php endif; ?>
            <div class="fixed"></div>
        </div>[/cce]

and before

[cce_php]        <div class="content">
            <?php the_content(); ?>
            <div class="fixed"></div>
        </div>[/cce]

add

[cce_php]        <!-- added by Spike -->
        <?php if (get_the_modified_time() != get_the_time()): ?>
            <div class="info">
                <div class="edit-date">
                    <?php printf('Last edited by <a href="%1$s" title="%2$s" rel="author">%3$s</a> on %4$s at %5$s',
                        esc_url( get_author_posts_url( get_the_author_meta( 'ID', get_post_meta($post->ID, '_edit_last', true) ) ) ),
                        esc_attr( sprintf( __( 'View all posts by %s', 'inove' ), get_the_modified_author() ) ),
                        get_the_modified_author(),
                        get_the_modified_time('j F Y'),
                        get_the_modified_time('G:i')
                    );?>
                </div>
                <div class="fixed"></div>
            </div>
        <?php endif; ?>
        <!-- end added by Spike -->[/cce]

 

In index.php after

[cce_php]        <div>
            <span><?php the_time(__('j F Y', 'inove')) ?></span>
            <?php if ($options['author']) : ?><span><?php the_author_posts_link(); ?></span><?php endif; ?>
            <?php edit_post_link(__('Edit', 'inove'), '<span>', '</span>'); ?>
            <span><?php comments_popup_link(__('No comments', 'inove'), __('1 comment', 'inove'), __('% comments', 'inove'), '', __('Comments off', 'inove')); ?></span>
            <div></div>
        </div>[/cce]

add exactly the same piece of code.

For both, at the end of style.css add

[cce_css]/* added by Spike */

.post .edit-date {
    background:url(img/calendar.png) no-repeat;
    padding-left:22px;
    height:16px;
    line-height:16px;
    display:block;
    font-size:11px;
}

/* end added by Spike */[/cce]

 

Categories: Wordpress, iNove

iNove theme: HTML5 search button

11 December 2013 No comments

This will help you to change the default search box with one in HTML5, like the one that you can find in Twenty Thirteen theme.

In

[cce]wp-content/themes/inove/functions.php[/cce]

just before

[cce_php]/** Comments */[/cce]

add

[cce_php]/** Search **/
add_theme_support( 'html5', array( 'search-form') );[/cce]

In

[cce]wp-content/themes/inove/templates/header.php[/cce]

delete

[cce_php]    <!-- searchbox START -->
    <div id="searchbox">
        <?php if($options['google_cse'] && $options['google_cse_cx']) : ?>
            <form action="http://www.google.com/cse" method="get">
                <div>
                    <input type="text" name="q" size="24" />
                    <input type="submit" name="sa" value="" />
                    <input type="hidden" name="cx" value="<?php echo $options['google_cse_cx']; ?>" />
                    <input type="hidden" name="ie" value="UTF-8" />
                </div>
            </form>
        <?php else : ?>
            <form action="<?php bloginfo('home'); ?>" method="get">
                <div>
                    <input type="text" name="s" size="24" value="<?php echo wp_specialchars($s, 1); ?>" />
                    <input type="submit" value="" />
                </div>
            </form>
        <?php endif; ?>
    </div>
<script type="text/javascript">
//<![CDATA[
    var searchbox = MGJS.$("searchbox");
    var searchtxt = MGJS.getElementsByClassName("textfield", "input", searchbox)[0];
    var searchbtn = MGJS.getElementsByClassName("button", "input", searchbox)[0];
    var tiptext = "<?php _e('Type text to search here...', 'inove'); ?>";
    if(searchtxt.value == "" || searchtxt.value == tiptext) {
        searchtxt.className += " searchtip";
        searchtxt.value = tiptext;
    }
    searchtxt.onfocus = function(e) {
        if(searchtxt.value == tiptext) {
            searchtxt.value = "";
            searchtxt.className = searchtxt.className.replace(" searchtip", "");
        }
    }
    searchtxt.onblur = function(e) {
        if(searchtxt.value == "") {
            searchtxt.className += " searchtip";
            searchtxt.value = tiptext;
        }
    }
    searchbtn.onclick = function(e) {
        if(searchtxt.value == "" || searchtxt.value == tiptext) {
            return false;
        }
    }
//]]>
</script>
    <!-- searchbox END -->[/cce]

and instead paste

[cce_php]<?php get_search_form(); ?>[/cce]

Now give it some style. At the end of style.css add

[cce_css]input[type="search"] {
  -webkit-appearance: textfield;
}

input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}


#navigation .search-form {
  float: right;
}

#navigation .search-field {
  background-color: transparent;
  background-image: url(img/search-icon.png);
  background-position: 5px center;
  background-repeat: no-repeat;
  background-size: 24px 24px;
  border: none;
  cursor: pointer;
  height: 28px;
  margin: 1px 0;
  padding: 0 0 0 34px;
  position: relative;
  -webkit-transition: width 400ms ease, background 400ms ease;
  transition:         width 400ms ease, background 400ms ease;
  width: 0;
}

#navigation .search-field:focus {
  background-color: #fff;
  border: 2px solid #D7D7D7;
  cursor: text;
  outline: 0;
  width: 230px;
  margin: 1px;
  -moz-box-sizing: border-box;
}

.screen-reader-text {
  display: none;
}

.search-form .search-submit {
  display: none;
}[/cce]

No, it will not work in Internet Explorer 8 :DGo and get a serious browser 😛

 

 

 

Enjoy 🙂

Categories: Wordpress, iNove

iNove theme: just one widget position on right sidebar

10 December 2013 No comments

In the iNove theme you have 4 positions:

  • north_sidebar
  • south_sidebar
  • west_sidebar
  • east_sidebar

but they are all on the right column. Plus, you have some widget hard coded like Recent posts/Random posts, Recent comments, Categories, Blogroll, Archives.

But now in WordPress you have extreme flexibility in what widgets we want to publish or not, so lets adopt it in iNove theme.

Edit

[cce]/wp-content/themes/inove/sidebar.php[/cce]

delete everything between

[cce_php]<!-- sidebar START -->[/cce]

and

[cce_php]<!-- sidebar END -->[/cce]

and paste just this

[cce_php]<!-- sidebar START -->
<div id="sidebar">
    <?php dynamic_sidebar( 'right_column' ); ?>
</div>
<!-- sidebar END -->[/cce]

Now open

[cce]/wp-content/themes/inove/functions.php[/cce]

delete entirely the part after //** widgets */

[cce_php]/** widgets */
if( function_exists('register_sidebar') ) {
    register_sidebar(array(
        'name' => 'north_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
    register_sidebar(array(
        'name' => 'south_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
    register_sidebar(array(
        'name' => 'west_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
    register_sidebar(array(
        'name' => 'east_sidebar',
        'before_widget' => '<div id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h3>',
        'after_title' => '</h3>'
    ));
}[/cce]

Instead paste

[cce_php]/** widgets */
add_action( 'widgets_init', 'my_register_sidebars' );

function my_register_sidebars() {

    register_sidebar(
        array(
            'id' => 'right_column',
            'name' => __( 'Right column' ),
            'description' => __( 'Widgets that will appear on the right column' ),
            'before_widget' => '<div id="%1$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>'
        )
    );

}[/cce]

Now edit style.css and delete this part

[cce_css]#centersidebar, 
#northsidebar .widget, 
#southsidebar .widget {
  background:url(img/widgetsep.png) bottom no-repeat;
  padding:10px 15px 16px;
}
#centersidebar {
  padding-bottom:6px;
}
#northsidebar, 
#southsidebar {
  font-size:95%;
}
#northsidebar .widget h2, 
#southsidebar .widget h2 {
  margin-bottom:10px;
}
#northsidebar .widget .content p, 
#southsidebar .widget .content p {
  margin-bottom:10px;
}
#westsidebar {
  width:121px;
  float:left;
  padding-right:5px;
  font-size:95%;
  overflow:hidden;
}
#eastsidebar {
  width:129px;
  float:right;
  font-size:95%;
  overflow:hidden;
}
#westsidebar h3, 
#eastsidebar h3 {
  margin-bottom:5px;
}
#westsidebar .widget, 
#eastsidebar .widget {
  margin-bottom:15px;
}[/cce]

Instead paste

[cce_css].widget {
  background:url(img/widgetsep.png) bottom no-repeat;
  padding:10px 15px 16px;
}
.widget h2 {
  margin-bottom:10px;
}
.widget .content p {
  margin-bottom:10px;
}[/cce]

Reference: Justin Tadlock – Sidebars in WordPress

 

 

Enjoy 🙂

Categories: Wordpress, iNove

iNove theme: display categories list and tag list only if present

10 December 2013 No comments
Last edited by on 13 December 2013 at 13:53

Change both index.php and single.php. Change from

[cce_php]            <?php if ($options['categories']) : ?><span><?php _e('Categories: ', 'inove'); ?></span><span><?php the_category(', '); ?></span><?php endif; ?>
            <?php if ($options['tags']) : ?><span><?php _e('Tags: ', 'inove'); ?></span><span><?php the_tags('', ', ', ''); ?></span><?php endif; ?>[/cce]

to

[cce_php]            <?php $categories_list = get_the_category_list( ', ', 'multiple' ); ?>
            <?php if (($options['categories']) && ($categories_list)) : ?>
                <span><?php _e('Categories: ', 'inove'); ?></span>
                <span><?php printf($categories_list); ?></span>
            <?php endif; ?>

            <?php $tag_list = get_the_tag_list( ', ', 'multiple' ); ?>
            <?php if (($options['tags']) && ($tag_list)) : ?>
                <span><?php _e('Tags: ', 'inove'); ?></span>
                <span><?php printf($tag_list); ?></span>
            <?php endif; ?>[/cce]

Then at the end of style.css add

[cce_css].post-categories li {
  list-style: none;
}[/cce]

Reference: Function Reference – get_the_category_list

 

 

 

Enoy 🙂

Categories: Wordpress, iNove