[Resolved] How to download page

Home Forums Support [Resolved] How to download page

Home Forums Support How to download page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1186651
    olusegun

    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

    #1187124
    David
    Staff
    Customer Support

    Hi there,

    what would be different to creating a static Page to contain the link ?

    #1188858
    olusegun

    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

    #1189041
    Tom
    Lead Developer
    Lead Developer

    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/

    #1189894
    olusegun

    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

    #1190220
    Tom
    Lead Developer
    Lead Developer

    Any chance you can link me to one of the posts? What’s the ID of the category you added to the function?

    #1190592
    olusegun

    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

    #1191313
    Tom
    Lead Developer
    Lead Developer

    Can you try has_category instead of in_category?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.