Clever Fox - Version 1.3

Version Description

  • Ameya Theme Functionality Added
Download this release

Release Info

Developer nayrathemes
Plugin Icon 128x128 Clever Fox
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

clever-fox.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Clever Fox
4
  Plugin URI:
5
  Description: The Clever Fox plugin adds sections functionality to the Startkit theme and Others Nayra's Themes. This plugin for only startkit themes. Clever Fox is a plugin build to enhance the functionality of WordPress Theme made by Nayra Themes.
6
- Version: 1.2
7
  Author: nayrathemes
8
  Author URI: https://nayrathemes.com
9
  Text Domain: clever-fox
@@ -49,8 +49,8 @@ function cleverfox_activate() {
49
  require_once('inc/conceptly/conceptly.php');
50
  }
51
 
52
- if( 'Asana' == $theme->name){
53
- require_once('inc/asana/asana.php');
54
  }
55
  }
56
  add_action( 'init', 'cleverfox_activate' );
3
  Plugin Name: Clever Fox
4
  Plugin URI:
5
  Description: The Clever Fox plugin adds sections functionality to the Startkit theme and Others Nayra's Themes. This plugin for only startkit themes. Clever Fox is a plugin build to enhance the functionality of WordPress Theme made by Nayra Themes.
6
+ Version: 1.3
7
  Author: nayrathemes
8
  Author URI: https://nayrathemes.com
9
  Text Domain: clever-fox
49
  require_once('inc/conceptly/conceptly.php');
50
  }
51
 
52
+ if( 'Ameya' == $theme->name){
53
+ require_once('inc/ameya/ameya.php');
54
  }
55
  }
56
  add_action( 'init', 'cleverfox_activate' );
inc/{asana/asana.php → ameya/ameya.php} RENAMED
File without changes
inc/ameya/default-pages/home-page.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //post status and options
3
+ $post = array(
4
+ 'comment_status' => 'closed',
5
+ 'ping_status' => 'closed' ,
6
+ 'post_author' => 1,
7
+ 'post_date' => date('Y-m-d H:i:s'),
8
+ 'post_name' => 'Home',
9
+ 'post_status' => 'publish' ,
10
+ 'post_title' => 'Home',
11
+ 'post_type' => 'page',
12
+ );
13
+ //insert page and save the id
14
+ $newvalue = wp_insert_post( $post, false );
15
+ if ( $newvalue && ! is_wp_error( $newvalue ) ){
16
+ update_post_meta( $newvalue, '_wp_page_template', 'templates/template-homepage.php' );
17
+
18
+ // Use a static front page
19
+ $page = get_page_by_title('Home');
20
+ update_option( 'show_on_front', 'page' );
21
+ update_option( 'page_on_front', $page->ID );
22
+
23
+ }
24
+ ?>
inc/ameya/default-pages/upload-media.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $file = CLEVERFOX_PLUGIN_URL .'inc/ameya/images/logo.png';
3
+ $ImagePath = CLEVERFOX_PLUGIN_URL .'inc/ameya/images';
4
+
5
+ $images = array(
6
+ $ImagePath. '/logo.png',
7
+ );
8
+ $parent_post_id = null;
9
+ foreach($images as $name) {
10
+ $filename = basename($name);
11
+ $upload_file = wp_upload_bits($filename, null, file_get_contents($name));
12
+ if (!$upload_file['error']) {
13
+ $wp_filetype = wp_check_filetype($filename, null );
14
+ $attachment = array(
15
+ 'post_mime_type' => $wp_filetype['type'],
16
+ 'post_parent' => $parent_post_id,
17
+ 'post_title' => preg_replace('/\.[^.]+$/', '', $filename),
18
+ 'post_excerpt' => 'hantus caption',
19
+ 'post_status' => 'inherit'
20
+ );
21
+ $ImageId[] = $attachment_id = wp_insert_attachment( $attachment, $upload_file['file'], $parent_post_id );
22
+
23
+ if (!is_wp_error($attachment_id)) {
24
+ require_once(ABSPATH . "wp-admin" . '/includes/image.php');
25
+ $attachment_data = wp_generate_attachment_metadata( $attachment_id, $upload_file['file'] );
26
+ wp_update_attachment_metadata( $attachment_id, $attachment_data );
27
+ }
28
+ }
29
+
30
+ }
31
+
32
+ update_option( 'conceptly_media_id', $ImageId );
33
+
34
+ ?>
inc/ameya/default-widgets/default-widget.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $activate = array(
3
+ 'conceptly-sidebar-primary' => array(
4
+ 'search-1',
5
+ 'recent-posts-1',
6
+ 'archives-1',
7
+ ),
8
+ 'conceptly-footer-widget-area' => array(
9
+ 'text-1',
10
+ 'categories-1',
11
+ 'archives-1',
12
+ 'search-1',
13
+ )
14
+ );
15
+ /* the default titles will appear */
16
+ update_option('widget_text', array(
17
+ 1 => array('title' => '',
18
+ 'text'=>'<div class="footer-logo"><img src="'.CLEVERFOX_PLUGIN_URL.'inc/ameya/images/footer-logo.png" alt=""></div>
19
+ <p>There are many variations of dummy passages of Lorem Ipsum a available, but the majority have suffered that is alteration in some that form injected humour or randomised.</p>
20
+ <ul class="widget-social">
21
+ <li><a href="#"><i class="fa fa-facebook"></i></a></li>
22
+ <li><a href="#"><i class="fa fa-twitter"></i></a></li>
23
+ <li><a href="#"><i class="fa fa-linkedin"></i></a></li>
24
+ <li><a href="#"><i class="fa fa-google-plus"></i></a></li>
25
+ <li><a href="#"><i class="fa fa-pinterest"></i></a></li>
26
+ <li><a href="#"><i class="fa fa-instagram"></i></a></li>
27
+ </ul>
28
+ '),
29
+ 2 => array('title' => 'Recent Posts'),
30
+ 3 => array('title' => 'Categories'),
31
+ ));
32
+ update_option('widget_categories', array(
33
+ 1 => array('title' => 'Categories'),
34
+ 2 => array('title' => 'Categories')));
35
+
36
+ update_option('widget_archives', array(
37
+ 1 => array('title' => 'Archives'),
38
+ 2 => array('title' => 'Archives')));
39
+
40
+ update_option('widget_search', array(
41
+ 1 => array('title' => 'Search'),
42
+ 2 => array('title' => 'Search')));
43
+
44
+ update_option('sidebars_widgets', $activate);
45
+ $MediaId = get_option('conceptly_media_id');
46
+ set_theme_mod( 'custom_logo', $MediaId[0] );
47
+ ?>
inc/ameya/images/footer-logo.png ADDED
Binary file
inc/ameya/images/logo.png ADDED
Binary file
inc/{asana → ameya}/sections/above-header.php RENAMED
File without changes
inc/cleverfox-activator.php CHANGED
@@ -50,6 +50,12 @@ class Cleverfox_Activator {
50
  require CLEVERFOX_PLUGIN_DIR . 'inc/conceptly/default-pages/home-page.php';
51
  require CLEVERFOX_PLUGIN_DIR . 'inc/conceptly/default-widgets/default-widget.php';
52
  }
 
 
 
 
 
 
53
  update_option( 'item_details_page', 'Done' );
54
  }
55
  }
50
  require CLEVERFOX_PLUGIN_DIR . 'inc/conceptly/default-pages/home-page.php';
51
  require CLEVERFOX_PLUGIN_DIR . 'inc/conceptly/default-widgets/default-widget.php';
52
  }
53
+
54
+ if ( 'Ameya' == $theme->name){
55
+ require CLEVERFOX_PLUGIN_DIR . 'inc/ameya/default-pages/upload-media.php';
56
+ require CLEVERFOX_PLUGIN_DIR . 'inc/ameya/default-pages/home-page.php';
57
+ require CLEVERFOX_PLUGIN_DIR . 'inc/ameya/default-widgets/default-widget.php';
58
+ }
59
  update_option( 'item_details_page', 'Done' );
60
  }
61
  }
readme.txt CHANGED
@@ -39,6 +39,9 @@ Clever Fox WordPress plugin is licensed under the GPL3 (https://www.gnu.org/lice
39
 
40
  == Changelog ==
41
 
 
 
 
42
  = 1.2 =
43
  * jQuery Issue Resolved
44
 
39
 
40
  == Changelog ==
41
 
42
+ = 1.3 =
43
+ * Ameya Theme Functionality Added
44
+
45
  = 1.2 =
46
  * jQuery Issue Resolved
47