Version Description
- Solved categories bug
Download this release
Release Info
Developer | anoopranawat |
Plugin | WP News and Scrolling Widgets |
Version | 3.1.1 |
Comparing to | |
See all releases |
Code changes from version 3.0 to 3.1.1
- css/stylenews.css +10 -7
- js/jcarousellite.js +8 -8
- readme.txt +200 -172
- sp-news-and-widget.php +123 -33
css/stylenews.css
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
-
.news-col-3, .news-col-2{-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
2 |
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
3 |
box-sizing: border-box; }
|
4 |
|
5 |
.news{margin-bottom:40px !important; clear:both;}
|
6 |
-
.news
|
|
|
|
|
7 |
.news-content{float:left; width:100%; clear:both;}
|
8 |
.date-post{width: 11%;float: left;text-align: center;}
|
9 |
.date-post span{display: block;color: #222;font-size: 30px;margin: 0px 0px 2px;padding-bottom: 2px;border-bottom: 1px dotted #C0C0C0;}
|
@@ -23,6 +25,7 @@ box-sizing: border-box; }
|
|
23 |
|
24 |
.recent-news-items{clear:both;}
|
25 |
|
|
|
26 |
.news-col-3{width:33%; float:left; clear:none !important; padding:0 15px;}
|
27 |
.news-col-2{width:50%; float:left; clear:none !important; padding:0 15px;}
|
28 |
.news-col-1{width:100%; float:left;}
|
@@ -30,13 +33,13 @@ box-sizing: border-box; }
|
|
30 |
.grid-news-thumb{float: left; height: 160px;line-height: 0; overflow: hidden; position: relative; width: 100%;}
|
31 |
.grid-news-thumb img{margin: 0 auto;opacity: 1;position: absolute; }
|
32 |
|
33 |
-
.news-col-3 h2, .news-col-2 h2{font-size:18px !important; line-height:20px !important; font-weight: normal !important}
|
34 |
-
.news-col-3 .news-content-excerpt, .news-col-2 .news-content-excerpt{display:none;}
|
35 |
-
.news-col-3 .news-thumb, .news-col-2 .news-thumb{margin-bottom:5px;}
|
36 |
-
.news-col-3 .post-content-text, .news-col-2 .post-content-text{width:100%; margin:0px;}
|
37 |
|
|
|
|
|
|
|
|
|
38 |
@media all and (max-width: 768px) {
|
39 |
-
.news-col-3, .news-col-2{width:100%;}
|
40 |
|
41 |
}
|
42 |
|
1 |
+
.news-col-3, .news-col-4, .news-col-2{-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
|
2 |
-moz-box-sizing: border-box; /* Firefox, other Gecko */
|
3 |
box-sizing: border-box; }
|
4 |
|
5 |
.news{margin-bottom:40px !important; clear:both;}
|
6 |
+
.news-col-1{padding-bottom:40px; border-bottom:1px solid #d1d1d1;}
|
7 |
+
.news .news-title{margin-top:0px; margin-bottom:10px !important;}
|
8 |
+
.news-cat{margin-bottom:10px ;}
|
9 |
.news-content{float:left; width:100%; clear:both;}
|
10 |
.date-post{width: 11%;float: left;text-align: center;}
|
11 |
.date-post span{display: block;color: #222;font-size: 30px;margin: 0px 0px 2px;padding-bottom: 2px;border-bottom: 1px dotted #C0C0C0;}
|
25 |
|
26 |
.recent-news-items{clear:both;}
|
27 |
|
28 |
+
.news-col-4{width:25%; float:left; clear:none !important; padding:0 15px;}
|
29 |
.news-col-3{width:33%; float:left; clear:none !important; padding:0 15px;}
|
30 |
.news-col-2{width:50%; float:left; clear:none !important; padding:0 15px;}
|
31 |
.news-col-1{width:100%; float:left;}
|
33 |
.grid-news-thumb{float: left; height: 160px;line-height: 0; overflow: hidden; position: relative; width: 100%;}
|
34 |
.grid-news-thumb img{margin: 0 auto;opacity: 1;position: absolute; }
|
35 |
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
.news-col-3 .news-thumb, .news-col-2 .news-thumb, .news-col-4 .news-thumb{margin-bottom:5px;}
|
38 |
+
.news-col-3 .post-content-text, .news-col-2 .post-content-text, .news-col-4 .post-content-text{width:100%; margin:0px;}p.news-short-content{margin-bottom:5px !important}
|
39 |
+
.first.last {clear: both !important;}
|
40 |
+
.first{clear: both !important;}
|
41 |
@media all and (max-width: 768px) {
|
42 |
+
.news-col-3, .news-col-2, .news-col-4{width:100%;}
|
43 |
|
44 |
}
|
45 |
|
js/jcarousellite.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
/*!
|
2 |
-
* jCarouselLite - v1.1 - 2014-09-28
|
3 |
-
* http://www.gmarwaha.com/jquery/jcarousellite/
|
4 |
-
* Copyright (c) 2014 Ganeshji Marwaha
|
5 |
-
* Licensed MIT (https://github.com/ganeshmax/jcarousellite/blob/master/LICENSE)
|
6 |
-
*/
|
7 |
-
|
8 |
-
!function(a){a.jCarouselLite={version:"1.1"},a.fn.jCarouselLite=function(b){return b=a.extend({},a.fn.jCarouselLite.options,b||{}),this.each(function(){function c(a){return n||(clearTimeout(A),z=a,b.beforeStart&&b.beforeStart.call(this,i()),b.circular?j(a):k(a),m({start:function(){n=!0},done:function(){b.afterEnd&&b.afterEnd.call(this,i()),b.auto&&h(),n=!1}}),b.circular||l()),!1}function d(){if(n=!1,o=b.vertical?"top":"left",p=b.vertical?"height":"width",q=B.find(">ul"),r=q.find(">li"),x=r.size(),w=x<b.visible?x:b.visible,b.circular){var c=r.slice(x-w).clone(),d=r.slice(0,w).clone();q.prepend(c).append(d),b.start+=w}s=a("li",q),y=s.size(),z=b.start}function e(){B.css("visibility","visible"),s.css({overflow:"hidden","float":b.vertical?"none":"left"}),q.css({margin:"0",padding:"0",position:"relative","list-style":"none","z-index":"1"}),B.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"}),!b.circular&&b.btnPrev&&0==b.start&&a(b.btnPrev).addClass("disabled")}function f(){t=b.vertical?s.outerHeight(!0):s.outerWidth(!0),u=t*y,v=t*w,s.css({width:s.width(),height:s.height()}),q.css(p,u+"px").css(o,-(z*t)),B.css(p,v+"px")}function g(){b.btnPrev&&a(b.btnPrev).click(function(){return c(z-b.scroll)}),b.btnNext&&a(b.btnNext).click(function(){return c(z+b.scroll)}),b.btnGo&&a.each(b.btnGo,function(d,e){a(e).click(function(){return c(b.circular?w+d:d)})}),b.mouseWheel&&B.mousewheel&&B.mousewheel(function(a,d){return c(d>0?z-b.scroll:z+b.scroll)}),b.auto&&h()}function h(){A=setTimeout(function(){c(z+b.scroll)},b.auto)}function i(){return s.slice(z).slice(0,w)}function j(a){var c;a<=b.start-w-1?(c=a+x+b.scroll,q.css(o,-(c*t)+"px"),z=c-b.scroll):a>=y-w+1&&(c=a-x-b.scroll,q.css(o,-(c*t)+"px"),z=c+b.scroll)}function k(a){0>a?z=0:a>y-w&&(z=y-w)}function l(){a(b.btnPrev+","+b.btnNext).removeClass("disabled"),a(z-b.scroll<0&&b.btnPrev||z+b.scroll>y-w&&b.btnNext||[]).addClass("disabled")}function m(c){n=!0,q.animate("left"==o?{left:-(z*t)}:{top:-(z*t)},a.extend({duration:b.speed,easing:b.easing},c))}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a(this);d(),e(),f(),g()})},a.fn.jCarouselLite.options={btnPrev:null,btnNext:null,btnGo:null,mouseWheel:!1,auto:null,speed:200,easing:null,vertical:!1,circular:!0,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null}}(jQuery);
|
1 |
+
/*!
|
2 |
+
* jCarouselLite - v1.1 - 2014-09-28
|
3 |
+
* http://www.gmarwaha.com/jquery/jcarousellite/
|
4 |
+
* Copyright (c) 2014 Ganeshji Marwaha
|
5 |
+
* Licensed MIT (https://github.com/ganeshmax/jcarousellite/blob/master/LICENSE)
|
6 |
+
*/
|
7 |
+
|
8 |
+
!function(a){a.jCarouselLite={version:"1.1"},a.fn.jCarouselLite=function(b){return b=a.extend({},a.fn.jCarouselLite.options,b||{}),this.each(function(){function c(a){return n||(clearTimeout(A),z=a,b.beforeStart&&b.beforeStart.call(this,i()),b.circular?j(a):k(a),m({start:function(){n=!0},done:function(){b.afterEnd&&b.afterEnd.call(this,i()),b.auto&&h(),n=!1}}),b.circular||l()),!1}function d(){if(n=!1,o=b.vertical?"top":"left",p=b.vertical?"height":"width",q=B.find(">ul"),r=q.find(">li"),x=r.size(),w=x<b.visible?x:b.visible,b.circular){var c=r.slice(x-w).clone(),d=r.slice(0,w).clone();q.prepend(c).append(d),b.start+=w}s=a("li",q),y=s.size(),z=b.start}function e(){B.css("visibility","visible"),s.css({overflow:"hidden","float":b.vertical?"none":"left"}),q.css({margin:"0",padding:"0",position:"relative","list-style":"none","z-index":"1"}),B.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"}),!b.circular&&b.btnPrev&&0==b.start&&a(b.btnPrev).addClass("disabled")}function f(){t=b.vertical?s.outerHeight(!0):s.outerWidth(!0),u=t*y,v=t*w,s.css({width:s.width(),height:s.height()}),q.css(p,u+"px").css(o,-(z*t)),B.css(p,v+"px")}function g(){b.btnPrev&&a(b.btnPrev).click(function(){return c(z-b.scroll)}),b.btnNext&&a(b.btnNext).click(function(){return c(z+b.scroll)}),b.btnGo&&a.each(b.btnGo,function(d,e){a(e).click(function(){return c(b.circular?w+d:d)})}),b.mouseWheel&&B.mousewheel&&B.mousewheel(function(a,d){return c(d>0?z-b.scroll:z+b.scroll)}),b.auto&&h()}function h(){A=setTimeout(function(){c(z+b.scroll)},b.auto)}function i(){return s.slice(z).slice(0,w)}function j(a){var c;a<=b.start-w-1?(c=a+x+b.scroll,q.css(o,-(c*t)+"px"),z=c-b.scroll):a>=y-w+1&&(c=a-x-b.scroll,q.css(o,-(c*t)+"px"),z=c+b.scroll)}function k(a){0>a?z=0:a>y-w&&(z=y-w)}function l(){a(b.btnPrev+","+b.btnNext).removeClass("disabled"),a(z-b.scroll<0&&b.btnPrev||z+b.scroll>y-w&&b.btnNext||[]).addClass("disabled")}function m(c){n=!0,q.animate("left"==o?{left:-(z*t)}:{top:-(z*t)},a.extend({duration:b.speed,easing:b.easing},c))}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a(this);d(),e(),f(),g()})},a.fn.jCarouselLite.options={btnPrev:null,btnNext:null,btnGo:null,mouseWheel:!1,auto:null,speed:200,easing:null,vertical:!1,circular:!0,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null}}(jQuery);
|
readme.txt
CHANGED
@@ -1,172 +1,200 @@
|
|
1 |
-
=== WP News and Scrolling Widgets ===
|
2 |
-
Contributors: wponlinesupport, 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: 4.3
|
6 |
-
Author URI: http://wponlinesupport.com
|
7 |
-
Stable tag: trunk
|
8 |
-
License: GPLv2 or later
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
-
|
11 |
-
A quick, easy way to add an News custom post type, News widget, vertical and horizontal scrolling news widget to Wordpress.
|
12 |
-
|
13 |
-
== Description ==
|
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 on your website.
|
16 |
-
|
17 |
-
View [DEMO](http://demo.wponlinesupport.com/sp-news/) for additional information.
|
18 |
-
|
19 |
-
View [screenshots](http://wordpress.org/plugins/sp-news-and-widget/screenshots/) for additional information.
|
20 |
-
|
21 |
-
= Installation help and support =
|
22 |
-
* Please check [installation help](http://wponlinesupport.com/plugin-installation-support/) on our website. View [Installation help and support](http://wponlinesupport.com/plugin-installation-support/)
|
23 |
-
* Get [Free installation and setup](http://wponlinesupport.com/plugin-installation-support/) on your website.
|
24 |
-
|
25 |
-
= Important Note For How to Install =
|
26 |
-
* 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"
|
27 |
-
* Now you can Display news post with the help of short code :
|
28 |
-
<code> [sp_news] </code>
|
29 |
-
* Also you can Display the news post with category wise :
|
30 |
-
<code> Sports news [sp_news category="category_id"] </code>
|
31 |
-
* Display News with Grid:
|
32 |
-
<code>[sp_news grid="2"] </code>
|
33 |
-
* Also you can Display the news post with Multiple categories wise
|
34 |
-
<code> Sports news :
|
35 |
-
[sp_news category="category_id"]
|
36 |
-
|
37 |
-
Arts news
|
38 |
-
[sp_news category="category_id"]
|
39 |
-
</code>
|
40 |
-
|
41 |
-
*
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
=
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
*
|
70 |
-
* News
|
71 |
-
*
|
72 |
-
*
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
=
|
129 |
-
*
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
*
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
*
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
=
|
150 |
-
*
|
151 |
-
*
|
152 |
-
*
|
153 |
-
|
154 |
-
= 2.
|
155 |
-
*
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== WP News and Scrolling Widgets ===
|
2 |
+
Contributors: wponlinesupport, 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: 4.3
|
6 |
+
Author URI: http://wponlinesupport.com
|
7 |
+
Stable tag: trunk
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
|
11 |
+
A quick, easy way to add an News custom post type, News widget, vertical and horizontal scrolling news widget to Wordpress.
|
12 |
+
|
13 |
+
== Description ==
|
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 on your website.
|
16 |
+
|
17 |
+
View [DEMO](http://demo.wponlinesupport.com/sp-news/) for additional information.
|
18 |
+
|
19 |
+
View [screenshots](http://wordpress.org/plugins/sp-news-and-widget/screenshots/) for additional information.
|
20 |
+
|
21 |
+
= Installation help and support =
|
22 |
+
* Please check [installation help](http://wponlinesupport.com/plugin-installation-support/) on our website. View [Installation help and support](http://wponlinesupport.com/plugin-installation-support/)
|
23 |
+
* Get [Free installation and setup](http://wponlinesupport.com/plugin-installation-support/) on your website.
|
24 |
+
|
25 |
+
= Important Note For How to Install =
|
26 |
+
* 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"
|
27 |
+
* Now you can Display news post with the help of short code :
|
28 |
+
<code> [sp_news] </code>
|
29 |
+
* Also you can Display the news post with category wise :
|
30 |
+
<code> Sports news [sp_news category="category_id"] </code>
|
31 |
+
* Display News with Grid:
|
32 |
+
<code>[sp_news grid="2"] </code>
|
33 |
+
* Also you can Display the news post with Multiple categories wise
|
34 |
+
<code> Sports news :
|
35 |
+
[sp_news category="category_id"]
|
36 |
+
|
37 |
+
Arts news
|
38 |
+
[sp_news category="category_id"]
|
39 |
+
</code>
|
40 |
+
|
41 |
+
* **Complete shortcode example:**
|
42 |
+
<code>[sp_news limit="10" category="category_id" grid="2" show_content="true" show_category_name="true" content_words_limit="30" ]</code>
|
43 |
+
|
44 |
+
* Comments for the news
|
45 |
+
|
46 |
+
* 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 from "news" to other name like "ournews", "latestnews etc" otherwise all your news will go to archive page.
|
47 |
+
|
48 |
+
= Following are News Parameters: =
|
49 |
+
|
50 |
+
* **limit :** [sp_news limit="10"] (Display latest 10 news and then pagination).
|
51 |
+
* **category :** [sp_news category="category_id"] (Display News categories wise).
|
52 |
+
* **grid :** [sp_news grid="2"] (Display News in Grid formats).
|
53 |
+
* **show_content :** [sp_news show_content="true" ] (Display News Short content OR not. By default value is "True". Options are "ture OR false").
|
54 |
+
* **show_category_name :** [sp_news show_category_name="true" ] (Display News category name OR not. By default value is "True". Options are "ture OR false").
|
55 |
+
* **content_words_limit :** [sp_news content_words_limit="30" ] (Control News short content Words limt. By default limit is 20 words).
|
56 |
+
|
57 |
+
|
58 |
+
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.
|
59 |
+
|
60 |
+
The plugin adds a News tab to your admin menu, which allows you to enter news items just as you would regular posts.
|
61 |
+
|
62 |
+
|
63 |
+
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
|
64 |
+
first select "Default" and save then again select "Custom Structure " and save.
|
65 |
+
|
66 |
+
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.
|
67 |
+
|
68 |
+
= Added New Features : =
|
69 |
+
* Shortcode <code> [sp_news] </code> for news page.
|
70 |
+
* Category wise News <code> Sports news [sp_news category="category_id"] </code>
|
71 |
+
* Display News with Grid [sp_news grid="2"]
|
72 |
+
* Added pagination [sp_news limit="10"]
|
73 |
+
* Added new shortcode parameters ie show_content, show_category_name and content_words_limit
|
74 |
+
|
75 |
+
|
76 |
+
= Features include: =
|
77 |
+
* Just create a news page with any name and add the shortcode <code> [sp_news] </code>
|
78 |
+
* Vertical and horizontal (Also added thumbnail option) news widget with setting page
|
79 |
+
* Setting page
|
80 |
+
* Easy to configure
|
81 |
+
* Smoothly integrates into any theme
|
82 |
+
* Yearly, Monthly and Daily archives
|
83 |
+
* News Categories
|
84 |
+
* News Tags
|
85 |
+
* 3 News widgets
|
86 |
+
* CSS and JS file for custmization
|
87 |
+
|
88 |
+
|
89 |
+
== Installation ==
|
90 |
+
|
91 |
+
1. Upload the 'sp-news-and-widget' folder to the '/wp-content/plugins/' directory.
|
92 |
+
1. Activate the SP News plugin through the 'Plugins' menu in WordPress.
|
93 |
+
1. Add and manage news items on your site by clicking on the 'News' tab that appears in your admin menu.
|
94 |
+
1. Create a page with the any name and paste this short code <code> [sp_news] </code>.
|
95 |
+
1. (Optional) Add and configure the News Items widget, vertical and horizontal news scrolling widget for one or more your sidebars.
|
96 |
+
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.
|
97 |
+
|
98 |
+
== Frequently Asked Questions ==
|
99 |
+
|
100 |
+
= What news templates are available? =
|
101 |
+
|
102 |
+
This plugin use your theme file content.php file
|
103 |
+
|
104 |
+
= Can I filter the list of news items by date? + =
|
105 |
+
|
106 |
+
Yes. Just as you can display a list of your regular posts by year, month, or day, you can display news items for a particular year (/news/2013/), month (/news/2013/04/), or day (/news/2013/04/20/).
|
107 |
+
|
108 |
+
= Do I need to update my permalinks after I activate this plugin? =
|
109 |
+
|
110 |
+
No, not usually. But if you are geting "/news" page OR 404 error on single news then please update your permalinks to Custom Structure.
|
111 |
+
|
112 |
+
= Are there shortcodes for news items? =
|
113 |
+
|
114 |
+
Yse <code> [sp_news] </code>.
|
115 |
+
|
116 |
+
== Screenshots ==
|
117 |
+
|
118 |
+
1. Display News with grid view
|
119 |
+
2. A complate view with comments
|
120 |
+
3. Display News with List view
|
121 |
+
4. Add new news
|
122 |
+
5. Single News view
|
123 |
+
6. Widgets
|
124 |
+
7. Admin setting page
|
125 |
+
|
126 |
+
== Changelog ==
|
127 |
+
|
128 |
+
= 3.1.1 =
|
129 |
+
* Solved categories bug
|
130 |
+
|
131 |
+
= 3.1 =
|
132 |
+
* Added new shortcode parameters ie show_content, show_category_name and content_words_limit
|
133 |
+
* Fixed some bug
|
134 |
+
|
135 |
+
= 3.0 =
|
136 |
+
* Display News with List view
|
137 |
+
* Display News with Grid [sp_news grid="2"]
|
138 |
+
* Added pagination [sp_news limit="10"]
|
139 |
+
|
140 |
+
= 2.2.1 =
|
141 |
+
* fixed the bug : Shows news on top of static page
|
142 |
+
|
143 |
+
|
144 |
+
= 2.2 =
|
145 |
+
* Call the news post with shortcode
|
146 |
+
* Call the news post with category wise
|
147 |
+
|
148 |
+
|
149 |
+
= 2.1 =
|
150 |
+
* Scroll main page news
|
151 |
+
* Setting page for enable or disable main page news scrolling
|
152 |
+
* Setting page for main news page vertical and horizontal news scrolling
|
153 |
+
|
154 |
+
= 2.0 =
|
155 |
+
* Added Vertical and horizontal news scrolling widget with setting page
|
156 |
+
* New UI designs
|
157 |
+
* Admin setting page
|
158 |
+
|
159 |
+
= 1.0 =
|
160 |
+
* Initial release
|
161 |
+
* Adds custom post type for News item
|
162 |
+
* Adds all and single page templates for news
|
163 |
+
* Adds Letest news widget
|
164 |
+
* Adds Vertical news scrolling widget
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
== Upgrade Notice ==
|
169 |
+
|
170 |
+
= 3.1.1 =
|
171 |
+
* Solved categories bug
|
172 |
+
|
173 |
+
= 3.1 =
|
174 |
+
* Added new shortcode parameters ie show_content, show_category_name and content_words_limit
|
175 |
+
* Fixed some bug
|
176 |
+
|
177 |
+
= 3.0 =
|
178 |
+
* Display News with List view
|
179 |
+
* Display News with Grid [sp_news grid="2"]
|
180 |
+
* Added pagination [sp_news limit="10"]
|
181 |
+
|
182 |
+
= 2.2.1 =
|
183 |
+
* fixed the bug : Shows news on top of static page
|
184 |
+
|
185 |
+
= 2.2 =
|
186 |
+
* Call the news post with shortcode
|
187 |
+
* Call the news post with category wise
|
188 |
+
|
189 |
+
= 2.1 =
|
190 |
+
Scroll main page news
|
191 |
+
Setting page for enable or disable main page news scrolling
|
192 |
+
Setting page for main news page vertical and horizontal news scrolling
|
193 |
+
|
194 |
+
= 2.0 =
|
195 |
+
Added Vertical and horizontal news scrolling widget with setting page
|
196 |
+
|
197 |
+
= 1.0 =
|
198 |
+
Initial release
|
199 |
+
|
200 |
+
|
sp-news-and-widget.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP News and three widgets(static, scrolling and scrolling with thumbs)
|
4 |
-
Plugin URL: http://wponlinesupport.com
|
5 |
Description: A simple News and three widgets(static, scrolling and scrolling with thumbs) plugin
|
6 |
-
Version: 3.
|
7 |
Author: WP Online Support
|
8 |
-
Author URI: http://wponlinesupport.com
|
9 |
Contributors: WP Online Support
|
10 |
*/
|
11 |
/*
|
@@ -49,10 +49,38 @@ function sp_cpt_news_init() {
|
|
49 |
'menu_position' => 8,
|
50 |
'menu_icon' => 'dashicons-feedback',
|
51 |
'supports' => array('title','editor','thumbnail','excerpt','comments'),
|
52 |
-
'taxonomies' => array('
|
53 |
);
|
54 |
register_post_type('news',$news_args);
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
function my_rewrite_flush() {
|
58 |
sp_cpt_news_init();
|
@@ -102,7 +130,7 @@ class SP_News_Widget extends WP_Widget {
|
|
102 |
echo $before_widget;
|
103 |
|
104 |
?>
|
105 |
-
|
106 |
<!--visual-columns-->
|
107 |
<div class="recent-news-items">
|
108 |
<ul>
|
@@ -175,7 +203,7 @@ class SP_News_scrolling_Widget extends WP_Widget {
|
|
175 |
echo $before_widget;
|
176 |
|
177 |
?>
|
178 |
-
|
179 |
<!--visual-columns-->
|
180 |
<div class="recent-news-items">
|
181 |
<div class="newsticker-jcarousellite">
|
@@ -251,7 +279,7 @@ class SP_News_thmb_Widget extends WP_Widget {
|
|
251 |
echo $before_widget;
|
252 |
|
253 |
?>
|
254 |
-
|
255 |
<!--visual-columns-->
|
256 |
<div class="recent-news-items">
|
257 |
<div class="newstickerthumb-jcarousellite">
|
@@ -301,7 +329,10 @@ function get_news( $atts, $content = null ){
|
|
301 |
extract(shortcode_atts(array(
|
302 |
"limit" => '',
|
303 |
"category" => '',
|
304 |
-
"grid" => ''
|
|
|
|
|
|
|
305 |
), $atts));
|
306 |
// Define limit
|
307 |
if( $limit ) {
|
@@ -319,8 +350,21 @@ function get_news( $atts, $content = null ){
|
|
319 |
} else {
|
320 |
$gridcol = '1';
|
321 |
}
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
ob_start();
|
325 |
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
|
326 |
|
@@ -328,33 +372,64 @@ function get_news( $atts, $content = null ){
|
|
328 |
$orderby = 'post_date';
|
329 |
$order = 'DESC';
|
330 |
|
331 |
-
|
332 |
-
|
|
|
|
|
333 |
'orderby' => $orderby,
|
334 |
'order' => $order,
|
335 |
-
'posts_per_page' => $posts_per_page,
|
336 |
-
'cat' => $cat,
|
337 |
'paged' => $paged,
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
|
345 |
-
<div id="post-<?php the_ID(); ?>" class="news type-news news-col-<?php echo $gridcol; ?>">
|
346 |
<div class="news-thumb">
|
347 |
<?php
|
348 |
// Post thumbnail.
|
349 |
-
if ( has_post_thumbnail() && $gridcol == '1') {
|
350 |
-
|
351 |
-
} else if($gridcol > '2') { ?>
|
352 |
<div class="grid-news-thumb">
|
353 |
-
|
354 |
</div>
|
355 |
<?php } else { ?>
|
356 |
<div class="grid-news-thumb">
|
357 |
-
|
358 |
</div>
|
359 |
<?php } ?>
|
360 |
</div>
|
@@ -363,20 +438,29 @@ function get_news( $atts, $content = null ){
|
|
363 |
<div class="date-post">
|
364 |
<h2><span><?php echo get_the_date('j'); ?></span></h2>
|
365 |
<p><?php echo get_the_date('M y'); ?></p>
|
|
|
366 |
</div>
|
367 |
<?php } else { ?>
|
368 |
<div class="grid-date-post">
|
369 |
-
<?php echo get_the_date('j, M y'); ?>
|
370 |
</div>
|
371 |
<?php } ?>
|
372 |
<div class="post-content-text">
|
373 |
-
<?php the_title( sprintf( '<
|
374 |
-
|
375 |
-
|
|
|
|
|
|
|
|
|
|
|
376 |
<div class="news-content-excerpt">
|
377 |
-
|
378 |
-
|
|
|
|
|
379 |
</div><!-- .entry-content -->
|
|
|
380 |
</div>
|
381 |
</div>
|
382 |
</div><!-- #post-## -->
|
@@ -393,7 +477,13 @@ function get_news( $atts, $content = null ){
|
|
393 |
return ob_get_clean();
|
394 |
}
|
395 |
add_shortcode('sp_news','get_news');
|
396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
function mynewsscript() {
|
398 |
$option = 'NewsWidget_option';
|
399 |
$newsscrollingoptionadmin = get_option( $option, $default );
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WP News and three widgets(static, scrolling and scrolling with thumbs)
|
4 |
+
Plugin URL: http://www.wponlinesupport.com/
|
5 |
Description: A simple News and three widgets(static, scrolling and scrolling with thumbs) plugin
|
6 |
+
Version: 3.1.1
|
7 |
Author: WP Online Support
|
8 |
+
Author URI: http://www.wponlinesupport.com/
|
9 |
Contributors: WP Online Support
|
10 |
*/
|
11 |
/*
|
49 |
'menu_position' => 8,
|
50 |
'menu_icon' => 'dashicons-feedback',
|
51 |
'supports' => array('title','editor','thumbnail','excerpt','comments'),
|
52 |
+
'taxonomies' => array('post_tag')
|
53 |
);
|
54 |
register_post_type('news',$news_args);
|
55 |
}
|
56 |
+
/* Register Taxonomy */
|
57 |
+
add_action( 'init', 'news_taxonomies');
|
58 |
+
function news_taxonomies() {
|
59 |
+
$labels = array(
|
60 |
+
'name' => _x( 'Category', 'taxonomy general name' ),
|
61 |
+
'singular_name' => _x( 'Category', 'taxonomy singular name' ),
|
62 |
+
'search_items' => __( 'Search Category' ),
|
63 |
+
'all_items' => __( 'All Category' ),
|
64 |
+
'parent_item' => __( 'Parent Category' ),
|
65 |
+
'parent_item_colon' => __( 'Parent Category:' ),
|
66 |
+
'edit_item' => __( 'Edit Category' ),
|
67 |
+
'update_item' => __( 'Update Category' ),
|
68 |
+
'add_new_item' => __( 'Add New Category' ),
|
69 |
+
'new_item_name' => __( 'New Category Name' ),
|
70 |
+
'menu_name' => __( 'Category' ),
|
71 |
+
);
|
72 |
+
|
73 |
+
$args = array(
|
74 |
+
'hierarchical' => true,
|
75 |
+
'labels' => $labels,
|
76 |
+
'show_ui' => true,
|
77 |
+
'show_admin_column' => true,
|
78 |
+
'query_var' => true,
|
79 |
+
'rewrite' => array( 'slug' => 'news-category' ),
|
80 |
+
);
|
81 |
+
|
82 |
+
register_taxonomy( 'news-category', array( 'news' ), $args );
|
83 |
+
}
|
84 |
|
85 |
function my_rewrite_flush() {
|
86 |
sp_cpt_news_init();
|
130 |
echo $before_widget;
|
131 |
|
132 |
?>
|
133 |
+
<h4 class="widget-title"><?php echo $title ?></h4>
|
134 |
<!--visual-columns-->
|
135 |
<div class="recent-news-items">
|
136 |
<ul>
|
203 |
echo $before_widget;
|
204 |
|
205 |
?>
|
206 |
+
<h4 class="widget-title"><?php echo $title ?></h4>
|
207 |
<!--visual-columns-->
|
208 |
<div class="recent-news-items">
|
209 |
<div class="newsticker-jcarousellite">
|
279 |
echo $before_widget;
|
280 |
|
281 |
?>
|
282 |
+
<h4 class="widget-title"><?php echo $title ?></h4>
|
283 |
<!--visual-columns-->
|
284 |
<div class="recent-news-items">
|
285 |
<div class="newstickerthumb-jcarousellite">
|
329 |
extract(shortcode_atts(array(
|
330 |
"limit" => '',
|
331 |
"category" => '',
|
332 |
+
"grid" => '',
|
333 |
+
"show_category_name" => '',
|
334 |
+
"show_content" => '',
|
335 |
+
"content_words_limit" => '',
|
336 |
), $atts));
|
337 |
// Define limit
|
338 |
if( $limit ) {
|
350 |
} else {
|
351 |
$gridcol = '1';
|
352 |
}
|
353 |
+
if( $show_category_name ) {
|
354 |
+
$showCategory = $show_category_name;
|
355 |
+
} else {
|
356 |
+
$showCategory = 'true';
|
357 |
+
}
|
358 |
+
if( $show_content ) {
|
359 |
+
$showContent = $show_content;
|
360 |
+
} else {
|
361 |
+
$showContent = 'true';
|
362 |
+
}
|
363 |
+
if( $content_words_limit ) {
|
364 |
+
$words_limit = $content_words_limit;
|
365 |
+
} else {
|
366 |
+
$words_limit = '20';
|
367 |
+
}
|
368 |
ob_start();
|
369 |
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
|
370 |
|
372 |
$orderby = 'post_date';
|
373 |
$order = 'DESC';
|
374 |
|
375 |
+
if($category)
|
376 |
+
{
|
377 |
+
$args = array (
|
378 |
+
'post_type' => $post_type,
|
379 |
'orderby' => $orderby,
|
380 |
'order' => $order,
|
381 |
+
'posts_per_page' => $posts_per_page,
|
|
|
382 |
'paged' => $paged,
|
383 |
+
'tax_query' => array(
|
384 |
+
array(
|
385 |
+
'taxonomy' => 'news-category',
|
386 |
+
'field' => 'id',
|
387 |
+
'terms' => $cat,
|
388 |
+
),
|
389 |
+
),
|
390 |
+
);
|
391 |
+
}else{
|
392 |
+
$args = array (
|
393 |
+
'post_type' => $post_type,
|
394 |
+
'orderby' => $orderby,
|
395 |
+
'order' => $order,
|
396 |
+
'posts_per_page' => $posts_per_page,
|
397 |
+
'paged' => $paged,
|
398 |
+
);
|
399 |
+
}
|
400 |
+
$query = new WP_Query($args);
|
401 |
+
$post_count = $query->post_count;
|
402 |
+
$count = 0;
|
403 |
+
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
|
404 |
+
$count++;
|
405 |
+
$terms = get_the_terms( $post->ID, 'news-category' );
|
406 |
+
$news_links = array();
|
407 |
+
if($terms){
|
408 |
+
|
409 |
+
foreach ( $terms as $term ) {
|
410 |
+
$term_link = get_term_link( $term );
|
411 |
+
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
412 |
+
}
|
413 |
+
}
|
414 |
+
$cate_name = join( ", ", $news_links );
|
415 |
+
$css_class="team";
|
416 |
+
if ( ( is_numeric( $grid ) && ( $grid > 0 ) && ( 0 == ($count - 1) % $grid ) ) || 1 == $count ) { $css_class .= ' first'; }
|
417 |
+
if ( ( is_numeric( $grid ) && ( $grid > 0 ) && ( 0 == $count % $grid ) ) || $post_count == $count ) { $css_class .= ' last'; }
|
418 |
+
?>
|
419 |
|
420 |
+
<div id="post-<?php the_ID(); ?>" class="news type-news news-col-<?php echo $gridcol.' '.$css_class; ?>">
|
421 |
<div class="news-thumb">
|
422 |
<?php
|
423 |
// Post thumbnail.
|
424 |
+
if ( has_post_thumbnail() && $gridcol == '1') { ?>
|
425 |
+
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('url'); ?></a>
|
426 |
+
<?php } else if($gridcol > '2') { ?>
|
427 |
<div class="grid-news-thumb">
|
428 |
+
<a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('thumbnail'); ?></a>
|
429 |
</div>
|
430 |
<?php } else { ?>
|
431 |
<div class="grid-news-thumb">
|
432 |
+
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium'); ?></a>
|
433 |
</div>
|
434 |
<?php } ?>
|
435 |
</div>
|
438 |
<div class="date-post">
|
439 |
<h2><span><?php echo get_the_date('j'); ?></span></h2>
|
440 |
<p><?php echo get_the_date('M y'); ?></p>
|
441 |
+
|
442 |
</div>
|
443 |
<?php } else { ?>
|
444 |
<div class="grid-date-post">
|
445 |
+
<?php echo get_the_date('j, M y'); ?><?php echo ($showCategory == 'true' && $cate_name != '') ? ' , '.$cate_name : ""?>
|
446 |
</div>
|
447 |
<?php } ?>
|
448 |
<div class="post-content-text">
|
449 |
+
<?php the_title( sprintf( '<h4 class="news-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h4>' ); ?>
|
450 |
+
|
451 |
+
<?php if($showCategory == 'true' && $gridcol == '1'){ ?>
|
452 |
+
<div class="news-cat">
|
453 |
+
<?php echo $cate_name; ?>
|
454 |
+
</div>
|
455 |
+
<?php }?>
|
456 |
+
<?php if($showContent == 'true'){?>
|
457 |
<div class="news-content-excerpt">
|
458 |
+
<?php $excerpt = get_the_excerpt();?>
|
459 |
+
<p class="news-short-content"><?php echo string_limit_words($excerpt,$words_limit); ?>...</p>
|
460 |
+
|
461 |
+
<a href="<?php the_permalink(); ?>" class="more-link">Read More</a>
|
462 |
</div><!-- .entry-content -->
|
463 |
+
<?php }?>
|
464 |
</div>
|
465 |
</div>
|
466 |
</div><!-- #post-## -->
|
477 |
return ob_get_clean();
|
478 |
}
|
479 |
add_shortcode('sp_news','get_news');
|
480 |
+
function string_limit_words($string, $word_limit)
|
481 |
+
{
|
482 |
+
$words = explode(' ', $string, ($word_limit + 1));
|
483 |
+
if(count($words) > $word_limit)
|
484 |
+
array_pop($words);
|
485 |
+
return implode(' ', $words);
|
486 |
+
}
|
487 |
function mynewsscript() {
|
488 |
$option = 'NewsWidget_option';
|
489 |
$newsscrollingoptionadmin = get_option( $option, $default );
|