- This topic has 7 replies, 3 voices, and was last updated 8 years, 9 months ago by Mahesh.
-
AuthorPosts
-
January 17, 2016 at 2:06 pm #83069AveeshParticipant
Hello,
I have Catch Themes Pro.
On a page, I want the fixed width to be 1400px – without affecting other pages that use the template full width no sidebar
I made a child theme, copied page-fullwidth.php to page-fixed width in my child theme directory (gave description of page fixed width no sidebar) and now want to set the fixed width
How do I assign it body class or What do i I need to do
Thanks
January 17, 2016 at 2:48 pm #83072MaheshParticipantHi @Aveesh,
Please post in your site url.
I assume you are using Catch Flames Pro. We do not have the file calledpage-fullwidth.php
in Catch Flames Pro.For this you can use the Custom CSS and get the specific page’s body class and change the width of the the content with-in that very class.
Or you can also add the desired body class by hooking a function into the
body_class
filter as follow:add_filter( 'body_class', 'catchflames_child_more_body_classes' ); function catchflames_child_more_body_classes( $class ) { $class[] = 'fixed-width-page'; return $class; }
Note: Add the above code in child theme’s
functions.php
.Regards,
MaheshJanuary 17, 2016 at 2:59 pm #83073AveeshParticipantHello Mahesh,
I am using Catch Box Pro v 4.3.2
and I am trying to modify page – http://www.jordanlesa.org/jobs/job-roster/
Using the Full width – no sidebar page template – it does NOT fill the width of the screen. I want it use the full width – which on my desktop is about 1600 px – but at least 1400 px (I understand this might look wierd on the mobile screen) or better would be to specify this width on non-mobile screen and have a scroll bar else
so I have made a child theme based on page-full-width.php from the catch-box-pro theme directory in my catch-box-pro-child theme directory and am wondering what to do next
From your email the function, how do i use the function (which I asssume is in funcions.php)
=====================
add_filter( 'body_class', 'catchflames_child_more_body_classes' );
function catchflames_child_more_body_classes( $class ) {
$class[] = 'fixed-width-page';
return $class;
}
=====================
So if I add a body class called full-fixed-width using the above function – how do i specify on the page template – I dont see anything similar in page-fullwidth.phpThanks
January 17, 2016 at 3:56 pm #83079MaheshParticipantHi @Aveesh,
If you are trying to make the content’s width to 1400px just for one page, I recommend you to use the Custom CSS instead. Like the code below:
.page-id-630 .site{ width: 1400px; }
It will only make the site’s width to 1400px which is not enough, you have to also change the width of the inner contents per the new width and manage for responsive views too. I recommend you to hire a customizer.
If you prefer to use the function as in the above code, edit your function as below:
add_filter( ‘body_class’, ‘catchflames_child_more_body_classes’ );
function catchflames_child_more_body_classes( $class ) {
if ( is_page( 630 ) ) {
$class[] = ‘fixed-width-page’;
}
return $class;
}The above function will add “fixed-width-page” to body for that particular page only.
Regards,
MaheshJanuary 17, 2016 at 4:08 pm #83080AveeshParticipantThanks Mahesh,
I didnt realize that page-id-# is also a a class I can use
That worked beautifully
Why doesnt usage of the full width no side bar template result is the FULL WIDTH by default – my screen is 1920 px wide
Thanks
January 17, 2016 at 4:35 pm #83081MaheshParticipantHi @Aveesh,
Catch Box Pro is a theme with boxed layout, the full-width for the page for all layout is 1000px whether the layout is full-with no sidebar or with sidebars.
Regards,
MaheshMarch 27, 2016 at 3:59 pm #88345oleviolinParticipantHi,
We just bought 2 copies of catch-flames pro for two different sites.We have seen that using
fixed-width
or the
.page-id-1555 .site{
width: 1900px;
}-option (as recommended above)
turns off the responsiveness in a somewhat counteproductive way, since the left margin moves to the right as the window-width shrinks, making the content gradually disapear to the right.
We are using a self made template on the page (which is a copy of the default index.php, but adding some for the application required javascript to that page)The question:
How can we adjust the maximum width of full-width of a fullwidth page. Which today for a 1920px screen amounts to something around 1267px, and still keep the page responsive?
best regards
oleviolinMarch 28, 2016 at 10:00 am #88391MaheshParticipant@oleviolin: Can you please clarify more. And please post in your site url.
Regards,
Mahesh -
AuthorPosts
- The topic ‘How to set Fixed width on page’ is closed to new replies.