Skip to content

Tag: wordpress

How to return only the last counter value in PHP for a custom field

How do you fetch the last value only from the following code. At the moment, this code prints all the rows but I just need to echo the last number only. I am using a custom repeater field that allows multiple uploads so I need the $counter variable to return the last number which I can then concatenate with D…

End excerpts with a full sentence for specific post types

I am trying to make excerpts end with a sentence, for a specific post type on my website, but for some reason, it is also effecting page excerpts and I cannot understand why. It doesn’t effect any of my other custom post types, just the one I specify in the function, and then all pages on the website. I…