Create a list of links in PHP?
Hi, I have this page https://chrisbarin.com/membership-account/membership-checkout/?level=1 built in WordPress that's using a very tricky plugin. I have little development experience. I'm looking to replace those blue links which are automatically created with custom links and text. So I'd like to replace the code with something like <name> then <url> so that I can easily change both.
Here's the entire code of that page in case it helps: https://pastebin.com/8ieDGPaD
PS: I only need the blue links edited, not the array of benefits underneath.
12 Replies
So you want to hard-code them in the pastebin file?
They're getting fetched from the database on line 5:
likely all you need to do is change the values in the database
not sure how to do that
I'd rather just change the list from that file
seems like a safer option for a beginner
there are loads of implications if I change those from the database
thanks for the suggestion though @jochemm
ok, if you do want to just hard code things, then you have to replace the part starting with
<?php
and ending with ?>
with the HTML you want to use:
What it's outputting right now is this:
Just repeat that how ever many times you need, and replace LINK_TO_THE_COURSE and TITLE_OF_THE_COURSE with the appropriate valuesawesome
the bit you need to replace starts at line 109 in your pastebin and ends at 126
now testing it.
I messed something up
the other bits underneath broke
you removed the <?php on line 128 as well, you need that
do I keep the <?php from 109 though?
and the answer is 'no' š
works!
thanks a lot! you're a life saver
I love learning this stuff
no worries!