Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If the theme is done properly, the body tag contains a class that identifies the page, for example
<body class="page page-id-989 page-template-default">
To solve the task, it is enough to add something like this to the CSS of the theme:body.page-id-989 .класс-заголовка {
/* тут нужные изменения */
}
here 989 is nothing but the id of the post.
You can implement a page template and select it when editing the page.
Here is an example of a template placed in the theme folder:
<?php
/*
Template Name: Свой шаблон страницы
*/
get_header();
get_sidebar();
get_footer();?>
Is the header a head or just a general designation for a header?
Do you need to raise it visually or in code?
How much higher?
if visually, then for each page wordpress generates its own class in the body. Further, I think it's clear.
if in the code, and, for example, the title needs to be moved to header.php, then you can do this
$page = ''; // id, название или slug страницы
if (is_page($page)) {
echo '<h1>'.get_the_title($ID);.'</h1>';
}
and will it be so good?
$page = ''; // id, название или slug страницы
if (is_page($page)) {
echo <bz1>.get_the_title($ID);.</bz1>;
}
CSS: body.page-id-X bz1 {margin-top:-10px;}
What is not like ((
$post->ID = '2'; // id, название или slug страницы
if (is_page($post)) { echo 'zdfgxdfgb';
<?php if(get_post_meta($post->ID, 'url', true)) { ?>
<bz><a href="<?php echo get_post_meta($post->ID, 'url', true); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></bz>
<?php } else { ?>
<bz><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></bz>
<?php } ?>
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question