0

please help me to display only tables on a canonical page

main page https://www.printerdriverforwindows.com/hp-deskjet-ink-advantage-3700-driver

    <table style="height: 198px; width: autopx;">
<tbody>
<tr style="height: 20.8px;">
<td style="width: 333.283px; height: 20.8px; text-align: center;"><strong>Filename</strong></td>
<td style="width: 56.7167px; height: 20.8px; text-align: center;"><strong>Size</strong></td>
<td style="width: 195px; height: 20.8px; text-align: center;"><strong>Download</strong></td>
</tr>
  </tbody>
</table>

want to display table content only on the download page

now using <?php the_content(); ?>

which shows full content

please help

0

You can try this. Let put the following code at the end of file functions.php on the theme or child theme.

add_action('wp_head', 'custom_show_table_on_download_page', 20);
function custom_show_table_on_download_page() { 
    if(is_single()){
        echo '<style type="text/css">.dpage {display: none !important;}</style>';
    }
}
  • the above code not working site down when the above code added – Ashija Pramod Dec 25 '18 at 4:54
  • @AshijaPramod Please send me a screenshot :D – Quang Dec 25 '18 at 4:56
  • which one function.php – Ashija Pramod Dec 25 '18 at 5:13
  • add_action('wp_head', 'custom_show_table_on_download_page', 20); function custom_show_table_on_download_page() { if(is_single()){ echo '<style type="text/css">.dpage {display: none !important;}</style>'; } }); – Ashija Pramod Dec 25 '18 at 5:16
  • added below function.php – Ashija Pramod Dec 25 '18 at 5:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.