Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 9 users online :: 0 Registered, 0 Hidden and 9 Guests :: 2 Bots
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
[SOLVED] Load wordpress blog post on FM
Page 1 of 1 • Share
- Cesar!New Member
- Gender :
Posts : 5
Points : 2956
Reputation : 0
Language : Romanian, English, French, basic Chinese
Browser : Forum Version :
Hi! I tought I had an account here but idk why it seems like I don't have so I made a new one. Whatever, I think that you can help me a bit, I'm a little confused. So I'm working on a personal website and I want to use some JS and feeds to import latest 3 posts from my wordpress.com blog. I wrote this but doesn't seems to work.
And this is how it should work(in the pic I used a feed from a FM forum)
Thanks in advance!
- code:
- Code:
function loadLastBlogPosts() {
$.get("WORDPRESS.COM/FEED_SITE", function( xml ) {
var _title, _link, _desc, _date;
for(var i = 0; i<3; i++) {
_title = xml.getElementsByTagName('item')[i].getElementsByTagName('title')[0].innerHTML;
_desc = xml.getElementsByTagName('item')[i].getElementsByTagName('description')[0].innerHTML;
_link = xml.getElementsByTagName('item')[i].getElementsByTagName('link')[0].innerHTML;
_date = xml.getElementsByTagName('item')[i].getElementsByTagName('pubDate')[0].innerHTML;
if( _title !== undefined && _desc !== undefined ) {
var str = "<div class="blog-post">";
str += "<h3><a href=""+ _link +"" target="_blank">" + _title + "</a></h3>";
str += "<div class="blog-desc">" + _desc + "</div>";
str += "<a class="blog-link" href=""+ _link +"" target="_blank">Read more...</a>";
str += "</div>";
$('#last-blog-posts').append(str);
}
}
})
.done(function(){
$('#last-blog-posts').css("display", "block");
$('#last-blog-posts-loading').remove();
if(!mobile) $('#last-blog-posts').slick({
dots: true,
speed: 600,
slidesToShow: 1,
autoplay: true,
autoplaySpeed: 5000,
adaptiveHeight: true
});
home_loaded = true;
})
.fail(function(){
$('#last-blog-posts').append("Error");
});
}
And this is how it should work(in the pic I used a feed from a FM forum)
Thanks in advance!
Hi, welcome to the forum !
I'm not familiar with wordpress, but have you taken a look at their developer resources ? I believe this one fits what you're trying to accomplish.
I'm not familiar with wordpress, but have you taken a look at their developer resources ? I believe this one fits what you're trying to accomplish.
- Cesar!New Member
- Gender :
Posts : 5
Points : 2956
Reputation : 0
Language : Romanian, English, French, basic Chinese
Browser : Forum Version :
Oh, I haven't looked on the dev resources. I think tomorrow I will take a look on that page haha.
Well, I want something like this but how can I integrate it into my carousel? And i just want it to show the latest 3 articles(like in image). Could you help with an advice or something?
Well, I want something like this but how can I integrate it into my carousel? And i just want it to show the latest 3 articles(like in image). Could you help with an advice or something?
It should be possible. I'd assume you just need to paste the code they provide into the carousel. As for the number of articles you might want to contact them to see if there's a way to modify that because I didn't see any notable options.
- Cesar!New Member
- Gender :
Posts : 5
Points : 2956
Reputation : 0
Language : Romanian, English, French, basic Chinese
Browser : Forum Version :
Doesn't really work when I put it in the carousel. I think I'm doing something wrong.
Might be better to try outside of the carousel first, by placing it in a widget, html page, homepage message etc.. just so you can make sure you have it setup correctly. From what I saw it looks like you need to include a script in your <head> and add another element wherever you want the blog posts to appear.
- Cesar!New Member
- Gender :
Posts : 5
Points : 2956
Reputation : 0
Language : Romanian, English, French, basic Chinese
Browser : Forum Version :
I'll try next days, I'm a bit busy. Thank's Ange, I'll update this.
- Cesar!New Member
- Gender :
Posts : 5
Points : 2956
Reputation : 0
Language : Romanian, English, French, basic Chinese
Browser : Forum Version :
I rewrote my code after I haven't made something with their widget and it's seems to work. Thanks Ange for the help!
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|