Hosting & Domaining Forum

Hosting & Domaining development => Web Design & Content => Topic started by: -DM- on Aug 01, 2022, 02:15 AM

Title: WordPress. Different design for different pages within the same theme.
Post by: -DM- on Aug 01, 2022, 02:15 AM
I need actionable advice.

I have a themed blog on Twenty Seventeen.
Initially, it was devoted to one topic, respectively, in the sections "Chat", FAQ, etc. there is a lot of information.
Its design, for example, the "header" picture, is also dedicated to the original theme.

Now we need to add a few more sections on similar topics, but the "title" picture in these sections needs a different one.
Also, these sections have their own "master pages" In the sense of pages that, of course, have internal addresses, but should behave the same way as the main one,
 - for example, the "header" picture should open completely.

It seems to be an obvious decision to make new blogs and somehow tie them with cross-links,
but "Chat", FAQ, technical sections of all these blogs should be the same (the ones that are now on the current blog).
Forwarding users to another blog is not the best option, people will just get confused ... Well, and all sorts of registration, plugins, etc.
So it's not really an option.

What can you advise if you do it with "little blood"
without deep intervention and re-layout of the theme, within one "standard template"?

Perhaps there are some tricky plugins or built-in functionality of WP itself?
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: Ali_Pro on Aug 01, 2022, 03:01 AM
If I understand your desire correctly, then for "new blogs" it is better to create custom content types and make your own template for each.
And in general, make a child theme.
All of these are "built-in functionality of WP itself", but there are different plugins to simplify working with them.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: _AnnA_ on Aug 01, 2022, 04:07 AM
Well what can we say?
Learn css.
Or install a profile plugin, SiteOrigin CSS for example.
It remains then to modify a little by hand.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: -DM- on Aug 01, 2022, 04:58 AM
Probably worth explaining more...

There is a site.
A blog opens in its right frame.

The blog has (in WP terms) "Home" and sections: "help me!", "the works", "chat", "guides".

I need to make two more pages with a different header image, which will be with the same template as the current "home" page, but with a different image at the top (in the header).

Plus, when loading these two pages, the header image should also open in full, and the menu should lead to the same sections ("help me!", "the works", "chat", "guides") as now.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: _AnnA_ on Aug 01, 2022, 05:10 AM
Two options:

1. Make a new template where the picture is located. In your case, most likely header.php.

2. With the help of php, you can replace images from one to another for certain pages.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: Newport on Aug 01, 2022, 06:12 AM
Change the image using css - one line, without additional dancing.

Are you talking about the s-art website?
By the way, do you know that the right frame is not visible on the phone?
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: -DM- on Aug 01, 2022, 06:24 AM
Quote from: Newport on Aug 01, 2022, 06:12 AMAre you talking about the s-art website?

Yes, about this project.
I'll deal with adaptability a little later, there is the simplest topic, without unnecessary difficulties.
Now it is important to solve this problem.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: _AnnA_ on Aug 01, 2022, 07:21 AM
Quote from: -DM- on Aug 01, 2022, 04:58 AMA blog opens in its right frame.

On the calendar 2022. What frames can!!!  ;)

Quote from: -DM- on Aug 01, 2022, 04:58 AMThe blog has (in WP terms) "Home" and sections: "help me!", "the works", "chat", "guides"

There are no "partitions" in VP terms at all.
"Main page" in terms of VP - page. And she was chosen as the main one.
And "help me!" is a record. I suspect that the rest too (too lazy to check).
But here's what is under the "guides" and "templates" items - these are the headings (accordingly with the entries .. should be ..).
And if you want to have "exactly the same, but different" (c), then you need custom types.

In your case, most likely header.php.
Look at the theme code
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: -DM- on Aug 01, 2022, 07:48 AM
Quote from: Newport on Aug 01, 2022, 06:12 AMChange the image using css - one line, without additional dancing.
I would be extremely grateful to you if you wrote what specific line, and in what CSS it should be inserted.
Unfortunately, I practically do not understand the structure of WP.

Post correction:
Quote from: Newport on Aug 01, 2022, 06:12 AMBy the way, do you know that the right frame is not visible on the phone?
Yes, that's what frames were made for. =)

Quote from: _AnnA_ on Aug 01, 2022, 07:21 AMOn the calendar 2022. What frames can!!!  ;)
I have been looking for a functionality for a very long time that can replace the concept of a frame - smoothly change the width, so that there are no jerks and the mouse cursor did not fall off the "separator" and I would be very grateful if you could tell me how to do this using modern methods.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: _AnnA_ on Aug 01, 2022, 10:01 AM
Quote from: -DM- on Aug 01, 2022, 07:48 AMI would be extremely grateful to you if you wrote what specific line, and in what CSS it should be inserted.

As soon as you show a specific page and give the image address.

Quote from: -DM- on Aug 01, 2022, 07:48 AMI have been looking for a functionality for a very long time that can replace the concept of a frame - smoothly change the width, so that there are no jerks and the mouse cursor did not fall off the "separator" and I would be very grateful if you could tell me how to do this using modern methods.

Set the width of the left side strictly in pixels (X px), the width of the right side - (100% - X px) and specify the minimum width of 1px.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: -DM- on Aug 01, 2022, 10:25 AM
Quote from: _AnnA_ on Aug 01, 2022, 10:01 AMAs soon as you show a specific page and give the image address.
First of all, thank you for your patience and participation!

I sent you the link in a private message. I don't want to publish my unfinished work for everyone. Superstitious. :)

I need the right parts (where the WP pages are):
http://go...iris.html (https://blog...s-art-iris-concept/
and
http://go...miracle.html (https://blog...miracle-concept/)

looked and worked the same as the right side
http://go. (https://blog.)

That is, the header also opened to the full page, and the menu "sticked" to the top of the screen, but the picture in the header was different.
I tried to "replace" the image at the js level hand-to-hand, but it's not so simple there - the template uses several sizes of the image on the splash screen.

I also tried using js to add the home and twentyseventeen-front-page classes to the body classes,
but the menu and title start to work crookedly, it seems that there are still some classes missing from other elements, or the main page in this Template (Twenty Seventeen) is processed by unique scripts...

Quote from: _AnnA_ on Aug 01, 2022, 10:01 AMSet the width of the left side strictly in pixels (X px), the width of the right side - (100% - X px) and specify the minimum width of 1px.

I need the user to be able to move the "red" border left and right with the mouse
plus the editor in the left frame, on smartphones automatically occupied the entire width of the screen (that is, "specify the width of the left side strictly in pixels" - does not fit conceptually)

(I tried a lot of approaches on js, but only the concept of frames works most stably, because this is processing by the browser code.
All the variants of the js code that I have tried either give the mouse off the "red line",
or at some point they "break" the layout on smartphones and tablets).
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: Newport on Aug 01, 2022, 11:59 AM
Quote from: -DM- on Aug 01, 2022, 07:48 AMI have been looking for a functionality for a very long time that can replace the concept of a frame - smoothly change the width, so that there are no jerks and the mouse cursor did not fall off the "separator" and I would be very grateful if you could tell me how to do this using modern methods.

The concept of a frame is not about changing the width, but simultaneously displaying different documents (web pages, if "in a simple way") on one page. And this is evil in the modern world. Well, except for home consumption will do.

As for changing the width of mice, this is done now, and 10 years ago, using js and css (in general, it's better to immediately build the site's architecture so that you don't need to do this). There is only one problem - it needs a specialist. A specialist with knowledge of WP, not just js.
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: _AnnA_ on Aug 01, 2022, 12:33 PM
Quote from: -DM- on Aug 01, 2022, 10:25 AMI need the right parts (where the WP pages are):
http://go...iris.html (https://blog...s-art-iris-concept/
and
http://go...miracle.html (https://blog...miracle-concept/)

looked and worked the same as the right side
http://go. (https://blog.)

Using the Custom body class (https://wordpress.org/plugins/wp-custom-body-class/) plugin or any similar (https://wordpress.org/plugins/search/body/) add the twentyseventeen-front-page class to the selected pages and add the rule to the additional styles
CSS Highlight Code
1
2
3
.page-id-138 #wp-custom-header img{
    content: url(https://full_path_to/images.jpg);
}
here .page-id-138 - id of the page on which you want to replace the image
repeat the required number of times.

Quote from: -DM- on Aug 01, 2022, 10:25 AMtried to "replace" the image at the js level hand-to-hand, but it's not so simple there - the template uses several sizes of the image on the splashscreen.

Why do you need WP if you crawl into the page code for every sneeze?
Title: Re: WordPress. Different design for different pages within the same theme.
Post by: -DM- on Aug 01, 2022, 01:56 PM
Quote from: _AnnA_ on Aug 01, 2022, 12:33 PMWhy do you need WP if you crawl into the page code for every sneeze?

Probably because I know js and don't know WP, I'm imprisoned for something else, so to speak...  ;D

THANK YOU VERY MUCH!!!!!!!!!!  :)