I have a few categories on hidden link like hidden link
my problem is: I put the image in a cpt and use this code in my category.php: <?php echo(types_render_field("afbeelding", array("alt"=>"$titel", "title"=>"$titel","width"=>"415","height"=>"415","proportional"=>"true"))); ?>
It works well, but I want to show up the image of the newest post, and not the oldest from the 3 on the page.
how can I fix this?
Dear Dido,
Please share the codes you are using to listing the images. You need to rewrite it.
--
With Regards
Bigul
I made 2 fields.
1 is a textfield (afbeelding) and the other a wywiwyg field. in the wysiwyg field I put a diashow using simple viewer.
This is the whole code I use in the single.php and in the category.php
<div id="cpt">
<?php echo(types_render_field("diashow", array("alt"=>"$titel", "title"=>"$titel", "width"=>"416","height"=>"500","proportional"=>"true"))); ?>
<?php echo(types_render_field("afbeelding", array("alt"=>"$titel", "title"=>"$titel","width"=>"415","height"=>"415","proportional"=>"true"))); ?>
</div>
Dear Dido,
Possible solution will be you have to re-order the WP Query from last to first. Then call following types API code.
< ?php echo(types_render_field("diashow", array("alt"=>"$titel", "title"=>"$titel", "width"=>"416","height"=>"500","proportional"=>"true"))); ?>
< ?php echo(types_render_field("afbeelding", array("alt"=>"$titel", "title"=>"$titel","width"=>"415","height"=>"415","proportional"=>"true"))); ?>
Please check this link for more details. http://codex.wordpress.org/Function_Reference/query_posts
–
With Regards
Bigul
Thanks Bigul, this was the solution. Because it was a little complicated for me, I asked a programmer to solve it for me. I can use this code for other websites too.
hidden link