Horje
Recode previous snippet from Linked List Plugin to new theme - Wordpress Solution
[Solved] - Recode previous snippet from Linked List Plugin to new theme - Wordpress Solution
Try following codes
Go to this [[LINK href="http://www.jorgeledesma.net/diamonds-and-debt/"]]post[[/LINK]] and notice the post meta has: Author jorge ledesma Categories Living Tags consumerism So far so good right, I'm going to make this easy for you guys. I have a linked list plugin running on the site and I'd like to add another "post-tags meta-item" called: Link and then add the text Jump to this Link ➚ with the corresponding url of the linked list post. So it will look like this now Author jorge ledesma Categories Living Tags consumerism Link Jump to this Link ➚ But I only it want to show up when the post has the actual linked list post. It gets better in a previous question Maor already gave me the code, so you would have to fix the code to match this theme single.php which is included as well. Maor's code from my previous theme modification is the following:
<?php $my_link = get_post_meta(get_the_ID(), 'linked_list_url', true);

       if ($my_link != '') { ?>

	<span class="meta-utility">Jump to this <a href="<?php echo $my_link;?>">Link ➚</a></span>

<?php } ?>
But keep in mind I want it to say "Link Jump to this Link ➚" Here is the chunk of code from my current theme's single.php
<span class="post-tags meta-item">
					<?php printf(__('<span class="label">Categories</span> <span class="meta-content">%s</span>', 'basicmaths'), get_the_category_list(', ', '</span>')) ?>
					<?php printf(__('%s', 'basicmaths'), get_the_tag_list('<span class="label">Tags</span> <span class="meta-content">', ', ', '</span>')) ?>
				</span>
				
			</div><!-- .entry-meta -->
Any question let me know. Cheers. So basically you have to rewrite that bit of code to match the semantic style of my current theme.

Solution - 1

I think you just simply change change the code to:

<?php $my_link = get_post_meta(get_the_ID(), 'linked_list_url', true);
       if ($my_link != '') { ?>
	<span class="label">Link</span> <span class="meta-content"><a href="<?php echo $my_link;?>">Jump to this link</a></span>
<?php } ?>


Solution - 2

No offence, but let's be serious. $5 is too low even for reading it all.


Solution - 3

combine the above two chunks of code


<span class="post-tags meta-item">

					<?php printf(__('<span class="label">Categories</span> <span class="meta-content">%s</span>', 'basicmaths'), get_the_category_list(', ', '</span>')) ?>

					<?php printf(__('%s', 'basicmaths'), get_the_tag_list('<span class="label">Tags</span> <span class="meta-content">', ', ', '</span>')) ?>

				</span>

<?php $my_link2 = get_post_meta(get_the_ID(), 'linked_list_url', true);



       if ($my_link2 != '') { ?>



	<span class="meta-utility">Link Jump to this <a href="<?php echo $my_link2;?>">Link ➚</a></span>



<?php } ?>				

</div><!-- .entry-meta -->

Date: 2022-10-21 05:19:39
Category: Wordpress
More for You