Version Description
- Call the news post with shortcode
- Call the news post with category wise
Download this release
Release Info
Developer | anoopranawat |
Plugin | WP News and Scrolling Widgets |
Version | 2.2 |
Comparing to | |
See all releases |
Code changes from version 2.0 to 2.2
- css/stylenews.css +3 -20
- readme.txt +62 -18
- sp-news-and-widget.php +72 -41
- views/all-news.php +0 -64
- views/single-news.php +0 -54
css/stylenews.css
CHANGED
@@ -1,27 +1,10 @@
|
|
1 |
-
.sp-news .archive-header{padding:0 0 10px 0; margin:0 0 10px 0; border:0px;}
|
2 |
-
.news img{padding:5px; background:#f8f8f8; border:1px solid #f1f1f1;}
|
3 |
-
.sp-news .archive-header h1{font-size:22px; text-transform:capitalize; line-height:25px;}
|
4 |
-
.sp-news h2{padding:0 0 10px 0; font-size:16px;}
|
5 |
-
.sp-news h2 a{text-decoration:none;}
|
6 |
-
.sp-news .date{display:block; background:url(../images/Calendar-Empty-icon.png) 0 50% no-repeat; padding:5px 0 5px 20px;}
|
7 |
-
.sp-news .news{clear:both; padding-bottom:20px;}
|
8 |
-
.sp-news .back{display:block; padding:10px 0;}
|
9 |
|
10 |
-
.
|
11 |
.SP_News_Widget ul li{padding:5px 0 5px 20px; border-bottom:1px solid #ddd; background:url(../images/Calendar-Empty-icon.png) 0 8px no-repeat; list-style:none !important;}
|
12 |
-
.SP_News_Widget ul li a{text-decoration:none; display:block;}
|
13 |
|
14 |
-
|
15 |
-
.SP_News_scrolling_Widget h4, .SP_News_thmb_Widget h4{font-size:22px; text-transform:capitalize; padding-bottom:5px;}
|
16 |
.SP_News_scrolling_Widget ul li{padding:5px 0 5px 20px; border-bottom:1px solid #ddd; background:url(../images/Calendar-Empty-icon.png) 0 8px no-repeat;}
|
17 |
-
.SP_News_scrolling_Widget ul li a{text-decoration:none; display:block;}
|
18 |
|
19 |
-
.SP_News_thmb_Widget li{list-style:none !important; padding:5px 0 5px 0px; border-bottom:1px solid #ddd; float:left; width:100%;}
|
20 |
-
.news_thumb_left{float:left;}
|
21 |
-
.news_thumb_left img{padding:5px; background:#f8f8f8; border:1px solid #f1f1f1; }
|
22 |
-
.news_thumb_right{float:left; margin-left:8px; }
|
23 |
|
24 |
-
|
25 |
-
.
|
26 |
-
.sp-news{ clear:both !important;}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
+
.sp-news .date{display:block; background:url(../images/Calendar-Empty-icon.png) 0 50% no-repeat; padding:5px 0 5px 20px;}
|
3 |
.SP_News_Widget ul li{padding:5px 0 5px 20px; border-bottom:1px solid #ddd; background:url(../images/Calendar-Empty-icon.png) 0 8px no-repeat; list-style:none !important;}
|
|
|
4 |
|
|
|
|
|
5 |
.SP_News_scrolling_Widget ul li{padding:5px 0 5px 20px; border-bottom:1px solid #ddd; background:url(../images/Calendar-Empty-icon.png) 0 8px no-repeat;}
|
|
|
6 |
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
|
9 |
+
.sp-news{overflow:hidden; clear:both !important;}
|
|
|
10 |
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== SP News and Scrolling Widgets ===
|
2 |
-
Contributors:
|
3 |
-
Tags: wordpress news plugin, wordpress vertical news plugin widget, wordpress horizontal news plugin widget , Free scrolling news wordpress plugin, Free scrolling news widget wordpress plugin, WordPress set post or page as news, WordPress dynamic news, news, latest news, custom post type, cpt, widget, vertical news scrolling widget, news widget
|
4 |
Requires at least: 3.1
|
5 |
-
Tested up to: 3.
|
6 |
Author URI: http://www.sptechnolab.com
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
@@ -14,23 +14,46 @@ A quick, easy way to add an News custom post type, News widget, vertical and hor
|
|
14 |
|
15 |
Every CMS site needs a news section. SP News allows you add, manage and display news, date archives, widget, vertical and horizontal news scrolling widget.
|
16 |
|
|
|
17 |
View [screenshots](http://wordpress.org/plugins/sp-news-and-widget/screenshots/) for additional information.
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
This plugin add a News custom post type, News widget, vertical and horizontal news scrolling widget( With setting page 'setting -> News Widget Setting') to your Wordpress site.
|
20 |
|
21 |
The plugin adds a News tab to your admin menu, which allows you to enter news items just as you would regular posts.
|
22 |
|
23 |
-
Your all news items will appear at '/news', and single news items will appear at '/news/<permalink>'.
|
24 |
-
|
25 |
-
Default Single news and All News templates for news items are also provided. One stylesheet is also provided with these templates so that you can design it as per your layout.
|
26 |
|
27 |
-
If you are getting any kind of problum with
|
28 |
first select "Default" and save then again select "Custom Structure " and save.
|
29 |
|
30 |
Finally, the plugin adds a Recent News Items widget and vertical news scrolling widget , which can be placed on any sidebar available in your theme. You can set the title of this list and the number of news items to show.
|
31 |
|
32 |
-
= New Features
|
33 |
-
*
|
|
|
|
|
|
|
|
|
|
|
34 |
* Vertical and horizontal (Also added thumbnail option) news widget with setting page
|
35 |
* Setting page
|
36 |
* Easy to configure
|
@@ -47,7 +70,7 @@ Finally, the plugin adds a Recent News Items widget and vertical news scrolling
|
|
47 |
1. Upload the 'sp-news-and-widget' folder to the '/wp-content/plugins/' directory.
|
48 |
1. Activate the SP News plugin through the 'Plugins' menu in WordPress.
|
49 |
1. Add and manage news items on your site by clicking on the 'News' tab that appears in your admin menu.
|
50 |
-
1. Create a page with the name
|
51 |
1. (Optional) Add and configure the News Items widget, vertical and horizontal news scrolling widget for one or more your sidebars.
|
52 |
1. Go to admin 'Setting page -> News Widget Setting' and enter your settings for vertical and horizontal news scrolling widgets eg Scrolling Direction, Number of news items, delay etc.
|
53 |
|
@@ -55,7 +78,7 @@ Finally, the plugin adds a Recent News Items widget and vertical news scrolling
|
|
55 |
|
56 |
= What news templates are available? =
|
57 |
|
58 |
-
|
59 |
|
60 |
= Can I filter the list of news items by date? + =
|
61 |
|
@@ -67,19 +90,31 @@ No, not usually. But if you are geting "/news" page OR 404 error on single news
|
|
67 |
|
68 |
= Are there shortcodes for news items? =
|
69 |
|
70 |
-
|
71 |
|
72 |
== Screenshots ==
|
73 |
|
74 |
-
1.
|
75 |
-
2.
|
76 |
-
3.
|
77 |
-
4.
|
78 |
-
5.
|
79 |
-
6.
|
|
|
80 |
|
81 |
== Changelog ==
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
= 2.0 =
|
84 |
* Added Vertical and horizontal news scrolling widget with setting page
|
85 |
* New UI designs
|
@@ -96,6 +131,15 @@ No, you just need to create a page with "News". Thats it
|
|
96 |
|
97 |
== Upgrade Notice ==
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
= 2.0 =
|
100 |
Added Vertical and horizontal news scrolling widget with setting page
|
101 |
|
1 |
=== SP News and Scrolling Widgets ===
|
2 |
+
Contributors: sptechnolab, anoopranawat
|
3 |
+
Tags: wordpress news plugin, main news page scrolling , wordpress vertical news plugin widget, wordpress horizontal news plugin widget , Free scrolling news wordpress plugin, Free scrolling news widget wordpress plugin, WordPress set post or page as news, WordPress dynamic news, news, latest news, custom post type, cpt, widget, vertical news scrolling widget, news widget
|
4 |
Requires at least: 3.1
|
5 |
+
Tested up to: 3.9.1
|
6 |
Author URI: http://www.sptechnolab.com
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
14 |
|
15 |
Every CMS site needs a news section. SP News allows you add, manage and display news, date archives, widget, vertical and horizontal news scrolling widget.
|
16 |
|
17 |
+
View [DEMO](http://wordpushplugins.in/latestnews/) for additional information.
|
18 |
View [screenshots](http://wordpress.org/plugins/sp-news-and-widget/screenshots/) for additional information.
|
19 |
|
20 |
+
=Important Note For How to Install =
|
21 |
+
|
22 |
+
*Please make sure that Permalink link should not be "/news" Otherwise all your news will go to archive page. You can give it other name like "/ournews, /latestnews etc"
|
23 |
+
|
24 |
+
*Now you can Display news post with the help of short code <code> [sp_news] </code>
|
25 |
+
|
26 |
+
*Also you can Display the news post with category wise <code> Sports news [sp_news category=category_id] </code>
|
27 |
+
|
28 |
+
*Also you can Display the news post with Multiple category wise
|
29 |
+
<code> Sports news
|
30 |
+
[sp_news category=category_id]
|
31 |
+
|
32 |
+
Arts news
|
33 |
+
[sp_news category=category_id]
|
34 |
+
</code>
|
35 |
+
|
36 |
+
*Comments for the news
|
37 |
+
|
38 |
+
*Users that are using version 2.1 please paste the shortcode in their News page <code> [sp_news] </code> and If your Permalink link is www.yourdoamin.com/news then plaese change to "news" to other name otherwise all your news will go to archive page.
|
39 |
+
|
40 |
This plugin add a News custom post type, News widget, vertical and horizontal news scrolling widget( With setting page 'setting -> News Widget Setting') to your Wordpress site.
|
41 |
|
42 |
The plugin adds a News tab to your admin menu, which allows you to enter news items just as you would regular posts.
|
43 |
|
|
|
|
|
|
|
44 |
|
45 |
+
If you are getting any kind of problum with news page means your are not able to see all news items then please remodify your permalinks Structure for example
|
46 |
first select "Default" and save then again select "Custom Structure " and save.
|
47 |
|
48 |
Finally, the plugin adds a Recent News Items widget and vertical news scrolling widget , which can be placed on any sidebar available in your theme. You can set the title of this list and the number of news items to show.
|
49 |
|
50 |
+
= Added New Features : =
|
51 |
+
* Shortcode <code> [sp_news] </code> for news page.
|
52 |
+
* Category wise News <code> Sports news [sp_news category=category_id] </code>
|
53 |
+
|
54 |
+
|
55 |
+
= Features include: =
|
56 |
+
* Just create a news page with any name and add the shortcode <code> [sp_news] </code>
|
57 |
* Vertical and horizontal (Also added thumbnail option) news widget with setting page
|
58 |
* Setting page
|
59 |
* Easy to configure
|
70 |
1. Upload the 'sp-news-and-widget' folder to the '/wp-content/plugins/' directory.
|
71 |
1. Activate the SP News plugin through the 'Plugins' menu in WordPress.
|
72 |
1. Add and manage news items on your site by clicking on the 'News' tab that appears in your admin menu.
|
73 |
+
1. Create a page with the any name and paste this short code <code> [sp_news] </code>.
|
74 |
1. (Optional) Add and configure the News Items widget, vertical and horizontal news scrolling widget for one or more your sidebars.
|
75 |
1. Go to admin 'Setting page -> News Widget Setting' and enter your settings for vertical and horizontal news scrolling widgets eg Scrolling Direction, Number of news items, delay etc.
|
76 |
|
78 |
|
79 |
= What news templates are available? =
|
80 |
|
81 |
+
This plugin use your theme file content.php file
|
82 |
|
83 |
= Can I filter the list of news items by date? + =
|
84 |
|
90 |
|
91 |
= Are there shortcodes for news items? =
|
92 |
|
93 |
+
Yse <code> [sp_news] </code>.
|
94 |
|
95 |
== Screenshots ==
|
96 |
|
97 |
+
1. Main page news scrolling
|
98 |
+
2. A complate view with comments
|
99 |
+
3. Admin all News items view
|
100 |
+
4. Add new news
|
101 |
+
5. Single News view
|
102 |
+
6. Widgets
|
103 |
+
7. Admin setting page
|
104 |
|
105 |
== Changelog ==
|
106 |
|
107 |
+
|
108 |
+
= 2.2 =
|
109 |
+
* Call the news post with shortcode
|
110 |
+
* Call the news post with category wise
|
111 |
+
|
112 |
+
|
113 |
+
= 2.1 =
|
114 |
+
* Scroll main page news
|
115 |
+
* Setting page for enable or disable main page news scrolling
|
116 |
+
* Setting page for main news page vertical and horizontal news scrolling
|
117 |
+
|
118 |
= 2.0 =
|
119 |
* Added Vertical and horizontal news scrolling widget with setting page
|
120 |
* New UI designs
|
131 |
|
132 |
== Upgrade Notice ==
|
133 |
|
134 |
+
= 2.2 =
|
135 |
+
* Call the news post with shortcode
|
136 |
+
* Call the news post with category wise
|
137 |
+
|
138 |
+
= 2.1 =
|
139 |
+
Scroll main page news
|
140 |
+
Setting page for enable or disable main page news scrolling
|
141 |
+
Setting page for main news page vertical and horizontal news scrolling
|
142 |
+
|
143 |
= 2.0 =
|
144 |
Added Vertical and horizontal news scrolling widget with setting page
|
145 |
|
sp-news-and-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: SP News and three widgets(static, scrolling and scrolling with thumbs)
|
4 |
Plugin URL: http://sptechnolab.com
|
5 |
Description: A simple News and three widgets(static, scrolling and scrolling with thumbs) plugin
|
6 |
-
Version: 2.
|
7 |
Author: SP Technolab
|
8 |
Author URI: http://www.sptechnolab.com
|
9 |
Contributors: SP Technolab
|
@@ -147,23 +147,25 @@ class SP_News_scrolling_Widget extends WP_Widget {
|
|
147 |
|
148 |
function form($instance) {
|
149 |
$instance = wp_parse_args((array) $instance, array( 'title' => '' ));
|
150 |
-
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
|
|
151 |
?>
|
152 |
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
|
153 |
-
|
154 |
<?php
|
155 |
}
|
156 |
|
157 |
function update($new_instance, $old_instance) {
|
158 |
$instance = $old_instance;
|
159 |
-
$instance['title'] = $new_instance['title'];
|
|
|
160 |
return $instance;
|
161 |
}
|
162 |
function widget($news_args, $instance) {
|
163 |
extract($news_args, EXTR_SKIP);
|
164 |
$current_post_name = get_query_var('name');
|
165 |
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
166 |
-
|
167 |
$postcount = 0;
|
168 |
|
169 |
echo $before_widget;
|
@@ -176,7 +178,7 @@ class SP_News_scrolling_Widget extends WP_Widget {
|
|
176 |
<ul>
|
177 |
<?php // setup the query
|
178 |
$news_args = array( 'suppress_filters' => true,
|
179 |
-
|
180 |
'post_type' => 'news',
|
181 |
'order' => 'DESC'
|
182 |
);
|
@@ -185,16 +187,13 @@ class SP_News_scrolling_Widget extends WP_Widget {
|
|
185 |
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
186 |
?>
|
187 |
<li >
|
188 |
-
|
189 |
<a class="post-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
190 |
-
|
191 |
</li>
|
192 |
<?php endwhile;
|
193 |
endif;
|
194 |
wp_reset_query(); ?>
|
195 |
-
|
196 |
</ul>
|
197 |
-
|
198 |
</div>
|
199 |
<?php
|
200 |
echo $after_widget;
|
@@ -292,28 +291,61 @@ function sp_news_thumb_widget_load_widgets() {
|
|
292 |
/* Load the widget */
|
293 |
add_action( 'widgets_init', 'sp_news_thumb_widget_load_widgets' );
|
294 |
|
295 |
-
function get_news_template( $template_path ) {
|
296 |
-
|
297 |
-
if ( get_post_type() == 'news' ) {
|
298 |
-
if ( is_single() ) {
|
299 |
-
|
300 |
-
if ( $theme_file = locate_template( array ( 'single-news.php' ) ) ) {
|
301 |
-
$template_path = $theme_file;
|
302 |
-
} else {
|
303 |
-
$template_path = plugin_dir_path( __FILE__ ) . '/views/single-news.php';
|
304 |
-
}
|
305 |
-
} elseif ( is_archive() ) {
|
306 |
-
if ( $theme_file = locate_template( array ( 'all-news.php' ) ) ) {
|
307 |
-
$template_path = $theme_file;
|
308 |
-
} else {
|
309 |
-
$template_path = plugin_dir_path( __FILE__ ) . '/views/all-news.php';
|
310 |
-
}
|
311 |
-
}
|
312 |
|
313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
-
return $template_path;
|
316 |
-
}
|
317 |
wp_register_style( 'cssnews', plugin_dir_url( __FILE__ ) . 'css/stylenews.css' );
|
318 |
wp_register_script( 'vticker', plugin_dir_url( __FILE__ ) . 'js/jcarousellite.js', array( 'jquery' ) );
|
319 |
|
@@ -326,7 +358,7 @@ wp_register_script( 'vticker', plugin_dir_url( __FILE__ ) . 'js/jcarousellite.js
|
|
326 |
$customscrollpostheight = $newsscrollingoptionadmin['news_height'];
|
327 |
$customscrollpostdelay = $newsscrollingoptionadmin['news_delay'];
|
328 |
$customscrollpostspeed = $newsscrollingoptionadmin['news_speed'];
|
329 |
-
|
330 |
if ($customscrollpost == 0 )
|
331 |
{
|
332 |
$vtrue = 'true';
|
@@ -347,31 +379,29 @@ wp_register_script( 'vticker', plugin_dir_url( __FILE__ ) . 'js/jcarousellite.js
|
|
347 |
$vspeed = 2000;
|
348 |
} else { $vspeed = $customscrollpostspeed;
|
349 |
}
|
350 |
-
|
351 |
?>
|
352 |
<script type="text/javascript">
|
353 |
|
354 |
jQuery(function() {
|
355 |
-
|
356 |
vertical: <?php echo $vtrue; ?>,
|
357 |
hoverPause:true,
|
358 |
visible: <?php echo $vvisible; ?>,
|
359 |
auto: <?php echo $vdelay; ?>,
|
360 |
speed:<?php echo $vspeed; ?>,
|
361 |
-
});
|
362 |
-
|
363 |
vertical: <?php echo $vtrue; ?>,
|
364 |
hoverPause:true,
|
365 |
visible: <?php echo $vvisible; ?>,
|
366 |
auto: <?php echo $vdelay; ?>,
|
367 |
-
speed:<?php echo $vspeed; ?>,
|
368 |
-
});
|
369 |
});
|
370 |
</script>
|
371 |
<?php
|
372 |
}
|
373 |
add_action('wp_head', 'mynewsscript');
|
374 |
-
add_filter( 'template_include', 'get_news_template' ) ;
|
375 |
|
376 |
class SP_News_setting
|
377 |
{
|
@@ -447,7 +477,7 @@ class SP_News_setting
|
|
447 |
|
448 |
add_settings_field(
|
449 |
'news_width', // ID
|
450 |
-
'Scrolling Direction (Vertical OR Horizontal) ', // Title
|
451 |
array( $this, 'news_width_callback' ), // Callback
|
452 |
'news-setting-admin', // Page
|
453 |
'setting_section_id' // Section
|
@@ -455,7 +485,7 @@ class SP_News_setting
|
|
455 |
|
456 |
add_settings_field(
|
457 |
'news_height',
|
458 |
-
'Number of news
|
459 |
array( $this, 'news_height_callback' ),
|
460 |
'news-setting-admin',
|
461 |
'setting_section_id'
|
@@ -474,7 +504,8 @@ class SP_News_setting
|
|
474 |
array( $this, 'news_speed_callback' ),
|
475 |
'news-setting-admin',
|
476 |
'setting_section_id'
|
477 |
-
);
|
|
|
478 |
}
|
479 |
|
480 |
/**
|
3 |
Plugin Name: SP News and three widgets(static, scrolling and scrolling with thumbs)
|
4 |
Plugin URL: http://sptechnolab.com
|
5 |
Description: A simple News and three widgets(static, scrolling and scrolling with thumbs) plugin
|
6 |
+
Version: 2.2
|
7 |
Author: SP Technolab
|
8 |
Author URI: http://www.sptechnolab.com
|
9 |
Contributors: SP Technolab
|
147 |
|
148 |
function form($instance) {
|
149 |
$instance = wp_parse_args((array) $instance, array( 'title' => '' ));
|
150 |
+
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
151 |
+
$num_items = isset($instance['num_items']) ? absint($instance['num_items']) : 5;
|
152 |
?>
|
153 |
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
|
154 |
+
<p><label for="<?php echo $this->get_field_id('num_items'); ?>">Number of Items: <input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo attribute_escape($num_items); ?>" /></label></p>
|
155 |
<?php
|
156 |
}
|
157 |
|
158 |
function update($new_instance, $old_instance) {
|
159 |
$instance = $old_instance;
|
160 |
+
$instance['title'] = $new_instance['title'];
|
161 |
+
$instance['num_items'] = $new_instance['num_items'];
|
162 |
return $instance;
|
163 |
}
|
164 |
function widget($news_args, $instance) {
|
165 |
extract($news_args, EXTR_SKIP);
|
166 |
$current_post_name = get_query_var('name');
|
167 |
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
168 |
+
$num_items = empty($instance['num_items']) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
169 |
$postcount = 0;
|
170 |
|
171 |
echo $before_widget;
|
178 |
<ul>
|
179 |
<?php // setup the query
|
180 |
$news_args = array( 'suppress_filters' => true,
|
181 |
+
'posts_per_page' => $num_items,
|
182 |
'post_type' => 'news',
|
183 |
'order' => 'DESC'
|
184 |
);
|
187 |
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
188 |
?>
|
189 |
<li >
|
|
|
190 |
<a class="post-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
|
|
191 |
</li>
|
192 |
<?php endwhile;
|
193 |
endif;
|
194 |
wp_reset_query(); ?>
|
|
|
195 |
</ul>
|
196 |
+
</div>
|
197 |
</div>
|
198 |
<?php
|
199 |
echo $after_widget;
|
291 |
/* Load the widget */
|
292 |
add_action( 'widgets_init', 'sp_news_thumb_widget_load_widgets' );
|
293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
+
function get_news( $atts, $content = null ){
|
296 |
+
// setup the query
|
297 |
+
extract(shortcode_atts(array(
|
298 |
+
"limit" => '',
|
299 |
+
"category" => '',
|
300 |
+
"comment_status" => ''
|
301 |
+
), $atts));
|
302 |
+
if( $comment_status == 'open' ) {
|
303 |
+
$com = 'open';
|
304 |
+
} else {
|
305 |
+
$com = 'closed';
|
306 |
+
}
|
307 |
+
// Define limit
|
308 |
+
if( $limit ) {
|
309 |
+
$posts_per_page = $limit;
|
310 |
+
} else {
|
311 |
+
$posts_per_page = '-1';
|
312 |
+
}
|
313 |
+
update_option( 'default_comment_status', $com );
|
314 |
+
if( $category ) {
|
315 |
+
$cat = $category;
|
316 |
+
} else {
|
317 |
+
$cat = '';
|
318 |
+
}
|
319 |
+
|
320 |
+
$news_args = array( 'suppress_filters' => true,
|
321 |
+
'posts_per_page' => $posts_per_page,
|
322 |
+
'post_type' => 'news',
|
323 |
+
'order' => 'DESC',
|
324 |
+
'cat' => $cat
|
325 |
+
);
|
326 |
+
|
327 |
+
|
328 |
+
$cust_loop = new WP_Query($news_args);
|
329 |
+
|
330 |
+
|
331 |
+
|
332 |
+
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post();
|
333 |
+
get_template_part( 'content');
|
334 |
+
endwhile;
|
335 |
+
endif;
|
336 |
+
wp_reset_query();
|
337 |
+
|
338 |
+
|
339 |
+
$status = get_option('default_comment_status');
|
340 |
+
if($status == 'open'){
|
341 |
+
comments_template();
|
342 |
+
}else {
|
343 |
+
}
|
344 |
+
|
345 |
+
}
|
346 |
+
add_shortcode('sp_news','get_news');
|
347 |
+
|
348 |
|
|
|
|
|
349 |
wp_register_style( 'cssnews', plugin_dir_url( __FILE__ ) . 'css/stylenews.css' );
|
350 |
wp_register_script( 'vticker', plugin_dir_url( __FILE__ ) . 'js/jcarousellite.js', array( 'jquery' ) );
|
351 |
|
358 |
$customscrollpostheight = $newsscrollingoptionadmin['news_height'];
|
359 |
$customscrollpostdelay = $newsscrollingoptionadmin['news_delay'];
|
360 |
$customscrollpostspeed = $newsscrollingoptionadmin['news_speed'];
|
361 |
+
|
362 |
if ($customscrollpost == 0 )
|
363 |
{
|
364 |
$vtrue = 'true';
|
379 |
$vspeed = 2000;
|
380 |
} else { $vspeed = $customscrollpostspeed;
|
381 |
}
|
|
|
382 |
?>
|
383 |
<script type="text/javascript">
|
384 |
|
385 |
jQuery(function() {
|
386 |
+
jQuery(".newsticker-jcarousellite").jCarouselLite({
|
387 |
vertical: <?php echo $vtrue; ?>,
|
388 |
hoverPause:true,
|
389 |
visible: <?php echo $vvisible; ?>,
|
390 |
auto: <?php echo $vdelay; ?>,
|
391 |
speed:<?php echo $vspeed; ?>,
|
392 |
+
});
|
393 |
+
jQuery(".newstickerthumb-jcarousellite").jCarouselLite({
|
394 |
vertical: <?php echo $vtrue; ?>,
|
395 |
hoverPause:true,
|
396 |
visible: <?php echo $vvisible; ?>,
|
397 |
auto: <?php echo $vdelay; ?>,
|
398 |
+
speed:<?php echo $vspeed; ?>,
|
399 |
+
});
|
400 |
});
|
401 |
</script>
|
402 |
<?php
|
403 |
}
|
404 |
add_action('wp_head', 'mynewsscript');
|
|
|
405 |
|
406 |
class SP_News_setting
|
407 |
{
|
477 |
|
478 |
add_settings_field(
|
479 |
'news_width', // ID
|
480 |
+
'Widget Scrolling Direction (Vertical OR Horizontal) ', // Title
|
481 |
array( $this, 'news_width_callback' ), // Callback
|
482 |
'news-setting-admin', // Page
|
483 |
'setting_section_id' // Section
|
485 |
|
486 |
add_settings_field(
|
487 |
'news_height',
|
488 |
+
'Number of news visible at a time',
|
489 |
array( $this, 'news_height_callback' ),
|
490 |
'news-setting-admin',
|
491 |
'setting_section_id'
|
504 |
array( $this, 'news_speed_callback' ),
|
505 |
'news-setting-admin',
|
506 |
'setting_section_id'
|
507 |
+
);
|
508 |
+
|
509 |
}
|
510 |
|
511 |
/**
|
views/all-news.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*Template Name: All News
|
3 |
-
*
|
4 |
-
* You can customize this view changeing the class name OR id name.
|
5 |
-
*
|
6 |
-
*/
|
7 |
-
|
8 |
-
get_header();
|
9 |
-
?>
|
10 |
-
|
11 |
-
<div id="primary" class="site-content">
|
12 |
-
<div id="content" role="main" class="sp-news widecolumn">
|
13 |
-
|
14 |
-
<div class="archive-header">
|
15 |
-
<h1 class="archive-title"><?php
|
16 |
-
if ( is_day() ) :
|
17 |
-
printf( __( 'Daily News Archives: %s' ), '<span>' . get_the_date() . '</span>' );
|
18 |
-
elseif ( is_month() ) :
|
19 |
-
printf( __( 'Monthly News Archives: %s' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
|
20 |
-
elseif ( is_year() ) :
|
21 |
-
printf( __( 'Yearly News Archives: %s' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
|
22 |
-
else :
|
23 |
-
_e( 'News' );
|
24 |
-
endif;
|
25 |
-
?></h1>
|
26 |
-
</div> <!-- .archive-header -->
|
27 |
-
|
28 |
-
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
29 |
-
|
30 |
-
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
31 |
-
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
|
32 |
-
<div class="post-info">
|
33 |
-
<span class="date published time" title="<?php the_time('c') ?>"><?php the_time('F j, Y') ?></span>
|
34 |
-
</div>
|
35 |
-
<div class="entry-content">
|
36 |
-
<?php
|
37 |
-
if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
|
38 |
-
the_post_thumbnail('thumbnail');
|
39 |
-
}
|
40 |
-
?>
|
41 |
-
<div class="summary"><?php the_excerpt(); ?> <a class="moretag" href="<?php the_permalink() ?>"> Read More..</a></div>
|
42 |
-
</div>
|
43 |
-
<?php edit_post_link(__('Edit'), '<span class="edit-link">', '</span>'); ?>
|
44 |
-
</div><!-- post -->
|
45 |
-
|
46 |
-
<?php endwhile; ?>
|
47 |
-
|
48 |
-
<div class="navigation">
|
49 |
-
<div class="alignleft"><?php next_posts_link('Previous entries') ?></div>
|
50 |
-
<div class="alignright"><?php previous_posts_link('Next entries') ?></div>
|
51 |
-
</div>
|
52 |
-
|
53 |
-
<?php else: ?>
|
54 |
-
|
55 |
-
<p>There are no news items to display.</p>
|
56 |
-
|
57 |
-
<?php endif; ?>
|
58 |
-
|
59 |
-
</div><!-- #content -->
|
60 |
-
|
61 |
-
</div><!--#primary-->
|
62 |
-
|
63 |
-
<?php get_sidebar(); ?>
|
64 |
-
<?php get_footer(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/single-news.php
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*Template Name: Single News
|
3 |
-
*
|
4 |
-
*You can customize this view changeing the class name OR id name.
|
5 |
-
*
|
6 |
-
*/
|
7 |
-
|
8 |
-
get_header();
|
9 |
-
?>
|
10 |
-
|
11 |
-
<div id="primary" class="site-content">
|
12 |
-
<div id="content" role="main" class="sp-news widecolumn">
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
<?php if( have_posts() ) : ?><?php while( have_posts() ) : the_post(); ?>
|
17 |
-
|
18 |
-
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
19 |
-
<div class="entry-header">
|
20 |
-
<h1 class="entry-title"><?php the_title(); ?></h1>
|
21 |
-
<div class="entry-meta post-info">
|
22 |
-
<span class="date published time" title="<?php the_time('c') ?>"><?php the_time('F j, Y') ?></span>
|
23 |
-
</div> <!-- .entry-meata .post-info -->
|
24 |
-
</div> <!-- .entry-header -->
|
25 |
-
<div class="entry-content">
|
26 |
-
<?php
|
27 |
-
if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
|
28 |
-
the_post_thumbnail();
|
29 |
-
} ?>
|
30 |
-
<div class="summary"><?php the_content(); ?></div>
|
31 |
-
</div> <!-- .entry-content -->
|
32 |
-
|
33 |
-
<?php edit_post_link(__('Edit'), '<span class="edit-link">', '</span>'); ?>
|
34 |
-
</div> <!-- post -->
|
35 |
-
|
36 |
-
<div class="navigation">
|
37 |
-
<?php previous_post_link('« %link') ?> <?php next_post_link(' %link >') ?>
|
38 |
-
</div>
|
39 |
-
|
40 |
-
<?php endwhile; ?>
|
41 |
-
|
42 |
-
<?php else: ?>
|
43 |
-
|
44 |
-
<p>There are no news items to display.</p>
|
45 |
-
|
46 |
-
<?php endif; ?>
|
47 |
-
<span class="back"><a href="/news/"><?php _e('« Back to News'); ?></a></span>
|
48 |
-
</div><!-- #content -->
|
49 |
-
|
50 |
-
</div><!--#primary-->
|
51 |
-
|
52 |
-
<?php get_sidebar(); ?>
|
53 |
-
|
54 |
-
<?php get_footer(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|