-
AuthorPosts
-
July 26, 2017 at 8:35 pm #830329
Hello,
At my main site at NowGuide.no I have a Blog Post presenting New Work Positions.
May I somehow get this Blog Post to show a dynamic value?In the post itself, I use a Code Block that catch a dynamic value from a public server.
In the Code Block Content it is now the following code:<script src=”//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”></script>
<div id=”a”></div>
<script>// <![CDATA[
$.ajax({
type: “GET”,
url: “https://tovare.com/api/stillinger”,
dataType: “json”,success: function (data) {
$(“#a”).text(data.stillinger + ” open work positions.”);
},
});// ]]></script>
The dynamic value is the data.stillinger
The whole tekst is today like this at the site:
Main site:
New Work Positions – Daily Updates
Our daily recommendation of the today’s Open Work Positions.
Read more →Post:
Recommendation of the today’s
14349 open work positions.July 30, 2017 at 6:55 am #831704Hey Loining,
Please, may you provide to us your website link and the WP and FTP credentials?
Best regards,
John TorvikJuly 31, 2017 at 9:54 am #832021Hello,
I will give you what I have.
The host is not willing to give me access to FTP.August 1, 2017 at 1:37 pm #832858Hi,
I’m not sure how if that would work since the content is only written to the database once you press save, I don’t think it would be possible to add dynamic values. What I come to think of off the top of my head would be to use a cron job but that would require a custom solution and would be out of scope of theme support unfortunately.
Best regards,
RikardAugust 1, 2017 at 2:39 pm #832893Off the top of your head, over the top of my head…
The web tells me: Cron Jobs are used for scheduling tasks to run on the server.
You then think I could ever so often write in a new text, – by the help of code – giving the right value into excerpt?
(Excerpts are optional hand-crafted summaries of your content that can be used in your theme. )August 2, 2017 at 6:28 am #833186Hi,
To be honest I’m not sure if a cron-job would work, it’s just something I thought of which might be a possibility. There is no functionality for anything like this is in the theme though, so I’m not sure we can help you out much more with this I’m afraid. I would recommend that you post your plans on a forum like stack-overflow, there are usually someone in places like that who can point you in the right direction.
Best regards,
RikardAugust 2, 2017 at 2:07 pm #833459Thank you!
That may be a good help for many of the topics I’m struggling with.August 3, 2017 at 5:27 am #833744 -
AuthorPosts
- You must be logged in to reply to this topic.