$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>functions - Only display table in the_content() in canonical page|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

functions - Only display table in the_content() in canonical page

matteradmin9PV0评论

please help me to display only tables on a canonical page

main page

    <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

please help me to display only tables on a canonical page

main page https://www.printerdriverforwindows/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

Share Improve this question asked Dec 25, 2018 at 3:07 Ashija PramodAshija Pramod 12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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>';
    }
}
Post a comment

comment list (0)

  1. No comments so far