- This topic has 7 replies, 3 voices, and was last updated 4 years, 1 month ago by Tom.
-
AuthorPosts
-
March 5, 2020 at 11:32 pm #1186651olusegun
hello guys, i run a file sharing website and i want to create an extra download page that comes up every time you click on the download link in my post. So the new page is the page that carries the download link to the file.
Thanks
Warm regardsMarch 6, 2020 at 7:34 am #1187124DavidStaffCustomer SupportHi there,
what would be different to creating a static Page to contain the link ?
March 8, 2020 at 11:16 am #1188858olusegunthanks i have created a new page to contain the link, i have added the page to a category but the next issue is that i want to noindex all the pages in the category and i found this online
<?php if (is_single() && in_category(array(###))) { echo ‘<meta name=”robots” content=”noindex, nofollow”>’; } ?>
Where ### post id in the category page url
And it says it should be added to the header but i dont know how to add it since element–>hook doesnt execute php and i dont want to install a plugin just for this purposeMarch 8, 2020 at 5:18 pm #1189041TomLead DeveloperLead DeveloperIn that case, you can use a function:
add_action( 'wp_head', function() { if (is_single() && in_category(array(###))) { echo '<meta name="robots" content="noindex, nofollow">'; } } );
Adding PHP: https://docs.generatepress.com/article/adding-php/
March 9, 2020 at 9:39 am #1189894olusegunokay Tom, i added the functions code to the functions.php in my child the and it doesn,t seem to get the job done because the pages i created a couple of hours ago after i added the code has been indexed by google.
Can you please provide me with any other idea that will workThanks
March 9, 2020 at 4:49 pm #1190220TomLead DeveloperLead DeveloperAny chance you can link me to one of the posts? What’s the ID of the category you added to the function?
March 10, 2020 at 4:16 am #1190592olusegunthis is a link to one of the post https://muzzmusic.com/download-bad-bunny-yhlqmdlg-album/ and I used my seo plugin to no index, no follow on this link but this method is not efficient because i have to publish the post before i can add the no index tag with the plugin plus i have to do it one post at a time and if googles finds the post before i use the plugin it will be indexed.
This is another link which i heven’t add the tag to using the plugin https://muzzmusic.com/download-jhene-aiko-chilombo-album/ and it is available to google.
The category id i used is the one i copied from the url in my admin panel “taxonomy=category&tag_ID=1191” thats part of the url containing the id 1191March 10, 2020 at 3:04 pm #1191313TomLead DeveloperLead DeveloperCan you try
has_category
instead ofin_category
? -
AuthorPosts
- You must be logged in to reply to this topic.