How to use a variable (for wordpress postid) in other queries?

by Tim   Last Updated August 13, 2019 18:08 PM

I don't know php, I just edit it for my needs, please excuse my possible mis-use of terms. I think the fact I am searching for the wrong terms has made this difficult to find a solution for, which is why I am asking.

Basically I need to define a postid, then use it multiple ways.

$number = 455;

So above you can see the number of a postid.

Then within my templates I am using it as follows.

echo get_the_permalink( '$number' );

How do I make that work?

echo get_the_permalink( '455' );

^ works fine, but it means me typing that id a lot.

Tags : php


Related Questions