- This topic has 22 replies, 3 voices, and was last updated 4 years ago by
David.
-
AuthorPosts
-
May 17, 2019 at 6:00 am #902523
d
theme: 2.2.2
GP Premium: 1.8.2I want to insert keywords,there is a php file that help me insert keywords from tag.
but when I insert the php file,the hook system got wrong,How to slove this?Thanks.hook code:
<?php include(‘seo.php’); ?>
<?php
if(is_single()){
echo ‘<script type=”application/ld+json”>{
…….etcaution:
Warning: include(): open_basedir restriction in effect. File(/www/server/php/72/lib/php/seo.php) is not within the allowed path(s): (/www/wwwroot/*/:/tmp/:/proc/) in /www/wwwroot/*/1557918395777/wp-content/themes/generatepress/header.php on line 19Warning: include(/www/server/php/72/lib/php/seo.php): failed to open stream: Operation not permitted in /www/wwwroot/*/1557918395777/wp-content/themes/generatepress/header.php on line 19
Warning: include(): Failed opening ‘seo.php’ for inclusion (include_path=’.:/www/server/php/72/lib/php’) in /www/wwwroot/*/1557918395777/wp-content/themes/generatepress/header.php on line 19
May 17, 2019 at 7:20 am #902707Tom
Lead DeveloperLead DeveloperHi there,
Where exactly did you add your include? Have you tried with the full path to
seo.php
?May 17, 2019 at 11:05 pm #903275d
this is seo.php file
https://prntscr.com/nq4hj6
this is hook setting
https://prntscr.com/nq4hj5
this is the caution
https://prntscr.com/nq4hj7I just want to insert keywords meta from tag.if there is other way/other plugin can do,I could change the way.
May 18, 2019 at 1:15 am #903320d
I use the mellow theme demo,where is the code to modify the space?(see image)
this is the problem:
https://prntscr.com/nq5esm
this is my wordpress editor
https://prntscr.com/nq5eskin normal,when didn’t use the section module,that’s no problem,
it will be like this:
https://prntscr.com/nq5fnd
Thanks!TomMay 18, 2019 at 7:52 am #903651Tom
Lead DeveloperLead DeveloperIt’s possible that includes won’t work inside hooks at all.
You may need to use a manual hook.
For example:
add_action( 'generate_before_content', function() { // Your include here. } );
May 18, 2019 at 7:18 pm #904015d
Thanks.Tom
now,I use mellow demo as a company website.my question are:
1. how to shut off the page default style(see the picture)?because the default theme-page-style is so narrow.
https://prntscr.com/nqf1i2
2. in gutenberg,the gallery can’t show at the frontend?(see the picture)
https://prntscr.com/nqf1i1May 19, 2019 at 8:33 am #904532Tom
Lead DeveloperLead Developer1. In Customize > Additional CSS, find and remove this CSS:
.no-sidebar:not(.generate-columns-activated) .inside-article > *, .no-sidebar #comments { max-width: 700px; margin-left: auto; margin-right: auto; }
2. I’m not too sure what you mean here. Can you explain a bit more?
May 23, 2019 at 3:04 am #908555d
Thanks!Tom
1st.thanks the additional CSS code,but if I want to change the entire page content to normal page(with hero,but no frame,see the picture),How?
https://prntscr.com/nsb2ji3rd. I add the code(to disable comment’s website) in the functuion.php in child theme,but can’t work?
the code:function alter_comment_form_fields($fields){ //$fields['author'] = ''; //removes name field //$fields['email'] = ''; //removes email field $fields['url'] = ''; //removes website field return $fields; } add_filter('comment_form_default_fields','alter_comment_form_fields'); add_filter('xmlrpc_enabled', '__return_false');
the result
https://prntscr.com/nsb2je4th, I read about the optimize in the generatepress(https://generatepress.com/fastest-wordpress-theme/) and the forum(somebody writed),
I am confused about the “also aggregate inline CSS?”in CSS option.
generatepress optimize tip said:It’s better to checked.
somebody in the forum said:It’s better to unchecked(for website speed,for example:google PageSpeed Insights)
now my option is unchecked.
so it’s really to checked it for better speed and seo?can you give me some advisement.
or it’s better to unchecked for better speed,because the inline css load at the sometime with HTML.5th.I am looking a lightweight post slider to show at the widget,I tried many plugin(smart slider is too big,Shortcodes Ultimate can’t work with the theme.et…),but I can’t find a perfected one, can you recommented a lightweight post slider?
May 23, 2019 at 4:36 pm #909225Tom
Lead DeveloperLead Developer1. You could try the Page Builder Container option: https://docs.generatepress.com/article/page-builder-container/
3. Try this:
add_filter('comment_form_default_fields', function($fields) { unset( $fields['url'] ); return $fields; }, 20 );
4. That option should just grab our CSS in the
<head>
section and cache it in their CSS file. We have it checked here on our website. You can always test your site speed with and without.5. Maybe something like this?: https://wordpress.org/plugins/soliloquy-lite/
May 26, 2019 at 6:49 am #911256d
Thanks!Tom
I want to solve these :6. recommented lightbox plugin?
the generatepress demo with lightbox,the plugin is WP Featherlight.but the plugin work only (In order for WordPress images and galleries to be lightboxed, you need to select the “Media File” option when choosing where the thumbnails should link.),so my Original article image isn’t select the “media file”,it’s a hard work to redo.
but the Meow Lightbox plugin load more JS.
so can you recomment a lightweight lightbox plugin or a method to solve it?7.thank to help me disable the comment website url with the function.php code. in fact,the code I paste is from my older theme, the code work with older theme,don’t work at generatepress theme.
so I paste more optimize code(clean extra head) from older theme’s function.php.
please to check it,is it right? or give me some method to optimize the extra head.Thanks.//about clean extra head
//add_filter( ’emoji_svg_url’, ‘__return_false’ );remove_action(‘wp_head’, ‘feed_links’, 2 );
remove_action(‘wp_head’, ‘feed_links_extra’, 3 );
remove_action(‘wp_head’,’rsd_link’);
remove_action(‘wp_head’,’wlwmanifest_link’);
remove_action(‘wp_head’,’wp_generator’);
remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’, 10, 0 );//rel=pre
remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10, 0 );//rel=shortlink//disable Embed
remove_action(‘rest_api_init’, ‘wp_oembed_register_route’);
remove_filter(‘rest_pre_serve_request’, ‘_oembed_rest_pre_serve_request’, 10, 4);remove_filter(‘oembed_dataparse’, ‘wp_filter_oembed_result’, 10 );
remove_filter(‘oembed_response_data’, ‘get_oembed_response_data_rich’, 10, 4);remove_action(‘wp_head’, ‘wp_oembed_add_discovery_links’);
remove_action(‘wp_head’, ‘wp_oembed_add_host_js’);//disable wp-json
remove_action( ‘wp_head’, ‘rest_output_link_wp_head’, 10 );
remove_action( ‘wp_head’, ‘wp_oembed_add_discovery_links’, 10 );May 26, 2019 at 9:30 am #911362Tom
Lead DeveloperLead Developer6. I’ve only ever played with Featherlight, unfortunately. It is its own standalone library, so you should be able to tweak it to work however you like: https://noelboss.github.io/featherlight/
7. That code looks good to me 🙂
May 31, 2019 at 7:39 pm #916758d
Thanks!Tom
8.how to change the site-name in the navi (independent)?so I don’t need to load the logo image.
I checked “Use Navigation as Header” and disable the hero navi color.
https://prnt.sc/nw64cj9.the footer custom font style can’t work?
https://prnt.sc/nw6bb7June 1, 2019 at 6:56 am #917134Tom
Lead DeveloperLead Developer8. The title in your navigation uses the title in “Customize > Site Identity”.
9. Not too sure what you mean?
June 1, 2019 at 6:06 pm #917377d
sorry for the ambiguity
8. how to change the site-name-color in the navi? I set it,but it didn’t change the color.
I checked “Use Navigation as Header” and disable the hero navi color.
https://prnt.sc/nw64cj
9. when I set font>footer>font size/ Font Weight,it didn’t working/changing.
https://prnt.sc/nw6bb7June 2, 2019 at 7:09 am #917775Tom
Lead DeveloperLead Developer8. You should be able to change it in Customize > Colors > Header.
9. The footer options are for the copyright bar. We’ll likely need to use CSS to target the footer widgets. What are you wanting to change?
-
AuthorPosts
- You must be logged in to reply to this topic.