• Resolved niklaslazinbee

    (@niklaslazinbee)


    Is it possible to use a php function in the repeater template?

    The following seems not to work

    <?php
    	function test(){
    		// do nothing
    	};
    ?>
    <li class="alm-item<?php if (!has_post_thumbnail()) { ?> no-img<?php } ?>">
       <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
    </li>

    No posts will be displayed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    @niklaslazinbee Yes, that should work assuming the test() function is loaded and accessible gloabally.

    Thread Starter niklaslazinbee

    (@niklaslazinbee)

    Strange, for me this does not work, the test() function is directly in the template field in the backend, so it should be available.

    My solution is: I have created a plugin and put the functions there, now I can call them in the repeater template.

    Plugin Author Darren Cooney

    (@dcooney)

    Ok, well not ideal but I’m glad to hear you solved it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP function in Repeater Templates’ is closed to new replies.