Many blog changes
This commit is contained in:
49
add_inline_css.php
Normal file
49
add_inline_css.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// Add inline CSS fix for buttons
|
||||
|
||||
$articles_dir = '/var/www/html/blog/articles/';
|
||||
$files = glob($articles_dir . '*.php');
|
||||
|
||||
$inline_css = '
|
||||
<style>
|
||||
.btn {
|
||||
background: #179e83 !important;
|
||||
color: white !important;
|
||||
padding: 15px 30px !important;
|
||||
border: none !important;
|
||||
border-radius: 5px !important;
|
||||
text-decoration: none !important;
|
||||
display: inline-block !important;
|
||||
font-family: Arial, sans-serif !important;
|
||||
font-size: 16px !important;
|
||||
font-weight: bold !important;
|
||||
text-align: center !important;
|
||||
cursor: pointer !important;
|
||||
margin: 10px 0 !important;
|
||||
min-width: 150px !important;
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
.btn:hover {
|
||||
background: #11725e !important;
|
||||
color: white !important;
|
||||
}
|
||||
</style>';
|
||||
|
||||
foreach ($files as $file) {
|
||||
$content = file_get_contents($file);
|
||||
|
||||
if ($content === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add inline CSS right before </head>
|
||||
if (strpos($content, '</head>') !== false && strpos($content, 'btn-fix-inline') === false) {
|
||||
$content = str_replace('</head>', $inline_css . "\n<!-- btn-fix-inline -->\n</head>", $content);
|
||||
|
||||
file_put_contents($file, $content);
|
||||
echo "Added inline CSS to: " . basename($file) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Inline CSS fix complete!\n";
|
||||
?>
|
||||
Reference in New Issue
Block a user