Archived topic
How to download page
7 replies · Started by olusegun on March 5, 2020
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 regards
Hi there,
what would be different to creating a static Page to contain the link ?
thanks 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 purpose
In 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/
okay 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 work
Thanks
Any chance you can link me to one of the posts? What's the ID of the category you added to the function?
this 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 1191
Can you try has_category instead of in_category?