Post Width
-
Hi,
If I am correct, the default post width is set at 786px. Questions as per below:
1. If I want to increase it to 900px, what are the css codes? Thanks.
2. Say I already increase the post width to 900px with the code above, how can I force my current post images width to be 900px as well?
Appreciate your reply. Thanks.
-
Hi @riderchris,
the default post width (on desktop) is set by default to 930px.
If you want to change the post width just go to your WordPress Dashboard under “Appearance-> Customize-> Additional CSS” and paste this code:.site-content, .site-footer { max-width: 930px; }
And change the number 930 with the value you prefer π
Best Regards,
CrestaProjectThanks that worked and my post width is now 1024px. However there is an issue, my images width are not width to 1024px.it is still on older width. How can i set my images width to be at 1024px as well? any css code for this? see the link for sample..
https://ibb.co/em7EJF
Hi @riderchris,
This is a bit more complicated π
You should edit the “functions.php” file of the theme and find the line:$GLOBALS['content_width'] = apply_filters( 'fortunato_content_width', 930 );
This way you can change “930” with your value.
But remember that this value will be reset to 930 every time there is a new theme update.Best Regards,
CrestaProjectI have created a child theme actually. If i made these changes, will i lose them after a theme update?
On another question, how can I change the post font types? I.e. Google fonts
Hi @riderchris,
in the PRO version you can change the Google Fonts directly using the theme options. In this case you can use the plugin called “Easy Google Fonts” to choose the font you prefer πBest Regards,
CrestaProjectThank for the recommendation, i’ll have a look at it. However you missed to answer my first question.
I have created a child theme on my site. If i made these changes in functon.php, will i lose them after a theme update?
Hi @riderchris,
ops sorry, if you have inserted the changes in a child theme you will not lose these changes πCrestaProject
I tried adding the codes into my function.php child theme file and the image width did not change to 1024px. My function.php file as per below:
/**
* Loads parent and child themes' style.css
*/
function orbisius_ctc_fortunato_child_theme_enqueue_styles() {
$parent_style = 'orbisius_ctc_fortunato_parent_style';
$parent_base_dir = 'fortunato';wp_enqueue_style( $parent_style,
get_template_directory_uri() . '/style.css',
array(),
wp_get_theme( $parent_base_dir ) ? wp_get_theme( $parent_base_dir )->get('Version') : ''
);wp_enqueue_style( $parent_style . '_child_style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}add_action( 'wp_enqueue_scripts', 'orbisius_ctc_fortunato_child_theme_enqueue_styles' );
$GLOBALS['content_width'] = apply_filters( 'fortunato_content_width', 1024 );
Hopefully someone will reply to my questions above. Is it because I need to specified the child theme name in your code? i.e. replace the fortunato word with ‘child_fortunato_contend_width?
$GLOBALS[‘content_width’] = apply_filters( ‘fortunato_content_width’, 1024 );
Thanks CrestaProject
Hi @riderchris,
Try to add this function in your functions.php child theme:function fortunato_child_content_width() { $GLOBALS['content_width'] = apply_filters( 'fortunato_content_width', 1024 ); } add_action( 'template_redirect', 'fortunato_child_content_width', 0 );
PS: not tested.
Best Regards,
CrestaProjectUnfortunately, that did not work, I understand this is not tested and I guess, I just need to give up on this unless you have something else for me to try?
Have a nice day Cresta Team.
Hi @riderchris,
if you want, can you link me your website?Best Regards,
CrestaProjectSure, it is http://www.riderchris.com and if you see the post at the link below, the image width does not tally with the post width of 1024px which I’ve changed.
It would be great if all the image width size can be at 1024px by default. Thanks for your help.
Hi @riderchris,
seems to work, look at this post https://www.riderchris.com/info/malaysia-thailand-border-crossing/ here it looks ok.
I think that in this page https://www.riderchris.com/trips/living-land-rice-farm/ the image are too small and then remains space.Best,
CrestaProjectHi thanks. I thought so, I did not add anything now for the function.php as the code below that you supplied seems to be working for both post width and image width.
.site-content, .site-footer {
max-width: XXXpx;
}You guys have been very helpful and it would be a shame if I could not support your work. I will email your team as I would like to purchase the premium version of this theme with your social share counter plugin. Keep up the good work.
- The topic ‘Post Width’ is closed to new replies.