Forum Replies Created
-
AuthorPosts
-
March 19, 2020 at 6:43 am in reply to: Current Header not appearing, though it's set in the customizer #497414David BorrinkParticipant
I got it to work by putting it in the style sheet. Thanks Vic and Anita for your advice. This will have to be the fix until my client decides to update to a more current theme.
March 12, 2020 at 6:48 am in reply to: Current Header not appearing, though it's set in the customizer #497293David BorrinkParticipantThanks, Anita for that theme-specific tip. So it's not really a swap code situation, I'm thinking. I may have to go that route of using the stylesheet. I was wondering what kind of a fix to implement and it looks like that might be it unless I find otherwise.
March 11, 2020 at 6:11 pm in reply to: Current Header not appearing, though it's set in the customizer #497279David BorrinkParticipantI found this in the Innov8tive theme's functions.php files, and it calls up the header. Removing it removes the site title and the site description.
/** Add support for custom header */ add_theme_support( 'genesis-custom-header', array( 'width' => 960, 'height' => 250, 'header_callback' => 'innov8tive_admin_style' ) ); /** Register a custom callback to style the custom header */ function innov8tive_admin_style() { $headimg = sprintf( '#header { background: url(%s) no-repeat center; min-height: %spx; }', get_header_image(), HEADER_IMAGE_HEIGHT ); printf( '<style type="text/css">%1$s</style>', $headimg); }
I looked in Genesis Sample 3.0.0 and found this line of code... by removing it, it takes out the logo, when testing in Genesis Sample 3.0.0...
// Displays custom logo. add_action( 'genesis_site_title', 'the_custom_logo', 0 );
But, putting the action from Genesis Sample 3.0.0 into the Innov8tive theme doesn't bring the logo into the layout. I replaced the above code when trying.
So I found something current that works, but I'm not sure how to bring it into the old theme.
March 11, 2020 at 2:28 pm in reply to: Current Header not appearing, though it's set in the customizer #497272David BorrinkParticipantOkay, so there's probably some header support in newer themes I need to look for. Thanks for pointing me in that direction, and apparently the limited info I found didn't cover that possibility. Thanks again, Victor. You're always a great help here.
June 17, 2018 at 7:26 am in reply to: Content archives setting for align left is not working #220905David BorrinkParticipantFound it. It was a function that somehow I forgot to delete after a failed test. I deleted it and all is well. It was this....
/** * Remove Image Alignment from Featured Image * */ function be_remove_image_alignment( $attributes ) { $attributes['class'] = str_replace( 'alignleft', 'aligncenter', $attributes['class'] ); return $attributes; } add_filter( 'genesis_attr_entry-image', 'be_remove_image_alignment' );
June 17, 2018 at 7:06 am in reply to: Content archives setting for align left is not working #220904David BorrinkParticipantIt does the same on my internal setup so that leads me to believe it's a theme issue. I'll try the default Genesis Sample theme, and not my theme modified from Genesis Sample, then compare my functions files. Perhaps I bumped a line at some point.
June 16, 2018 at 9:37 pm in reply to: Content archives setting for align left is not working #220895David BorrinkParticipantSo it can't be a plug-in update since we have done none in the last 48 hours.
I can go into the HTML in my inspector, and change a feature image's class to "align left" and the CSS takes over and makes the image align left, go to 50% width and allow the text to move to the right.... the way it should be.
The issue still remains, why is "align left" not being assigned to the HTML when it's clearly set in the Content Archives settings? But I can set it to none, center, and right without any problem and it works. But set it to left and it goes center.
Baffled.
June 14, 2018 at 7:59 pm in reply to: Want to add an ad widget after certain number of paragraphs via a function #220845David BorrinkParticipantThat's it! It works perfectly. Just the way I wanted it to.
Thank you!
And now I need to brush up a little more on actions and filters and the proper understanding of them in the content.
June 14, 2018 at 7:29 am in reply to: Want to add an ad widget after certain number of paragraphs via a function #220824David BorrinkParticipantThanks, Victor and Brad, I always appreciate your input on things. I made a bunch of changes from your suggestions, Victor, and thanks for the working examples, Brad. Here's what I came up with...
// Register adbar widget for to go after a specific paragraph on pages and only a specific category of posts register_sidebar( array( 'name' => __( 'Below Post Title (unit studies) and Page Title Ad Space', 'tto' ), 'id' => 'post-page-below-title-ad-space', 'description' => __( 'PAGES AND UNIT STUDY POSTS. Will appear after a specific number of paragraphs.', 'tto' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // place widget after specified paragraph on pages and only posts with the unit-study-activities category add_filter( 'the_content' , 'sb_widget_in_the_content' ); function sb_widget_in_the_content ($content) { if( is_page() || in_category('unit-study-activities') ) // next line is the paragraph number to specify... $show_after_p = 2; $content = apply_filters('the_content', $post->post_content); if(substr_count($content, '<p>') > $show_after_p) { $contents = explode("</p>", $content); $p_count = 1; foreach($contents as $content) { echo $content; if($p_count == $show_after_p) { ?> <div class="content-ad-space"> <?php if ( is_active_sidebar( 'post-page-below-title-ad-space' ) ) : ?> <?php dynamic_sidebar( 'post-page-below-title-ad-space' ); ?> <?php endif; ?> </div><!-- .content-ad-space--> <?php } echo "</p>"; $p_count++; } } return $content; }
And I got this error with so much to unpack I don't even know where to start! LOL. Maybe you can decipher this in a simpler way because it's way too complicated.
Fatal error: Uncaught Error: Call to undefined function add_filters() in /Applications/MAMP/htdocs/wordpress/wp-content/themes/sallieborrink-2018/functions.php:349 Stack trace: #0 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-hook.php(286): sb_widget_in_the_content('<p>1 This is a ...') #1 /Applications/MAMP/htdocs/wordpress/wp-includes/plugin.php(203): WP_Hook->apply_filters('<p>1 This is a ...', Array) #2 /Applications/MAMP/htdocs/wordpress/wp-includes/post-template.php(240): apply_filters('the_content', '1 This is a tex...') #3 /Applications/MAMP/htdocs/wordpress/wp-content/themes/genesis/lib/structure/post.php(361): the_content() #4 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-hook.php(286): genesis_do_post_content('') #5 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #6 /Applications/MAMP/htdocs/wordpress/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7 /Applications/MAMP/htdocs/wordpress/wp-content/themes/genesis/lib/structure in /Applications/MAMP/htdocs/wordpress/wp-content/themes/sallieborrink-2018/functions.php on line 349
The "1 This is a...." is the first paragraph in the test post. I have 12 numbered paragraphs to help me determined the placement of my inserted ad widget.
June 13, 2018 at 7:04 pm in reply to: Trying to add an ad widget via function with a specific paragraph number #220807David BorrinkParticipantI wrote up a function to place an ad widget after a specified number of paragraphs in pages and in posts that have a specific category. My site is based on Genesis Sample 2.3.0. This function uses a snippet I found at https://www.doitwithwp.com/inserts-ads-after-a-few-paragraphs-wordpress/. I registered a widget area and placed the call up of the widget within the function. I'm not getting any results and I'm not sure why. I'm filtering
the_content
within a conditional of pages and posts of a specific category. I'll paste my code below. Any ideas why I'm not getting results?// Register adbar widget for to go after a specific paragraph on pages and only a specific category of posts register_sidebar( array( 'name' => __( 'Below Post Title (unit studies) and Page Title Ad Space', 'tto' ), 'id' => 'post-page-below-title-ad-space', 'description' => __( 'PAGES AND UNIT STUDY POSTS. Will appear after a specific number of paragraphs.', 'tto' ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // place widget after specified paragraph on pages and only posts with the unit-study-activities category if( is_page() || is_category('unit-study-activities') ) { add_filter( 'genesis_entry_content' , 'sb_widget_in_the_content' ); function sb_widget_in_the_content () { // next line is the paragraph number to specify... $show_after_p = 2; $content = apply_filters('the_content', $post->post_content); if(substr_count($content, '<p>') > $show_after_p) { $contents = explode("</p>", $content); $p_count = 1; foreach($contents as $content) { echo $content; if($p_count == $show_after_p) { ?> <div class="content-ad-space"> <?php if ( is_active_sidebar( 'post-page-below-title-ad-space' ) ) : ?> <?php dynamic_sidebar( 'post-page-below-title-ad-space' ); ?> <?php endif; ?> </div><!-- .content-ad-space--> <?php } echo "</p>"; $p_count++; } } else { the_content(); } } }
April 30, 2018 at 4:29 pm in reply to: Code added to restore excerpt tags controls my excerpt length #219447David BorrinkParticipantHi Brad, thanks for all your information. I put only this code in and tried it,
add_filter( 'get_the_content_limit_allowedtags', 'get_the_content_limit_custom_allowedtags' ); function get_the_content_limit_custom_allowedtags() { // Add custom tags to this string return '<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>,<p>,<strong>'; }
and set the Genesis > Content Archives > Display > Entry Content option to Entry Content with a 1000 for the moment. There are shorter-than-1000 posts on the front page, but the longer ones appear to have the length okay. I haven't tried the other code yet regarding excerpt length.
I see a lot of my tags are showing up now, bolds, italics, links, and it looks like they're closing properly at the moment. What I don't understand is why
<p>
doesn't work, even though it's specced in the code. That's the one I want to really fix so the shortened "excerpt" starts to read like the actual post.David BorrinkParticipantYour code might be in one of the plug-in's style sheets. When that happens, what I do is put the overriding code in the "Additional Code" area in the dashboard Customizer.
.simple-social-icons ul li a, .simple-social-icons ul li a:hover, .simple-social-icons ul li a:focus { padding: 9px 4px; }
See if that works. Then edit the second number to get the spacing the way you like it.
David BorrinkParticipantYour items in that row of buttons are using this selector:
.simple-social-icons ul li a
and one of the settings is the padding which is at 9px. This setting has 9 pixels of padding on all four sides of each object. The objects touch each other. The only way you'll bring them closer together is to reduce the padding setting.
If you want the height the vertical positioning to stay the same but bring them closer together horizontally, you'll need to use this padding setting:
Instead of
padding: 9x;
you'll need to saypadding: 9px 4px;
(or anything smaller than 9px for the second number)which would keep your top and bottom puddings at 9px, but reduce the left and right paddings of each object, thus leaving a 8px gap between the icons instead of 18px (which is a result of having two padding areas of 9px touching each other; by doing 4px on each side, you have 8px between the icons. Get it?)
April 1, 2018 at 6:15 pm in reply to: How to Remove Space Between Slider & Nav Bar?- Infinity PRO #218536David BorrinkParticipantGreat. And as I read your question again I realized that you are doing a global situation. I just did a front page only situation on a site, so I had "one page only" on the brain. LOL.
March 30, 2018 at 9:29 pm in reply to: How to Remove Space Between Slider & Nav Bar?- Infinity PRO #218485David BorrinkParticipantRight now, your slider has a margin setting of 80px on the top and bottom, and 65px on the sides, but obviously your slider has a full-width setting that overrides the left and right side settings. These settings are on line 650 of the style.css file, referencing the .content class for your site.
You'll need to edit your theme's CSS file so that instead of it looking like this:
padding: 80px 60px;
(in case you don't know, when they're showing only two values, it automatically assigns the first one as vertical and the second one as horizontal)
... to this...
padding: 0px 60px 80px;
(and this means when three values are shown, the first is top, the second is the sides and the third is bottom).
BUT.... just that edit alone would change all the pages on your site so that the content is 80 px closer to the nav bar. If you want this to happen on this page only, then you need to add a custom CSS line that states this will only happen on this page (which according to your body tags on your html is page-id-31....
.page-id-31 .content { padding: 0 px 60px 80px; }
That should do it.
David BorrinkParticipantI installed it in a folder within my theme and I called it up using an @font within my CSS. It showed up fine after a few seconds whenever a page loads. I took it off the site in question, so it's not an example to see.
Just wondered if anyone knew why there would be a delay in being visible. It's not browser dependent or OS dependent. It happened everywhere.
January 31, 2018 at 3:22 pm in reply to: Using Google Recaptcha with Genesis, positioning of Recaptcha #215930David BorrinkParticipantTranslated via Google: Our technical boiler service in Madrid is authorized by the Community of Madrid and certified by the Ministry of Industry so that all the attention you receive from our boiler inspection department will be reliable and guaranteed, which is why our technical service is one of the but recommended to carry out the revision of your natural gas boiler, butane propane.
Yeah, Julianfra. Whatever.
January 31, 2018 at 2:21 pm in reply to: Using Google Recaptcha with Genesis, positioning of Recaptcha #215925David BorrinkParticipantHi Victor, thanks for replying. My theme is basically Genesis Sample so there's no override on the comments.
Where is the genesis_after_comment_form action?
I did a search in my genesis theme for genesis_after_comment_form and the two files it came up in are comments.php (which is listed in my previous post) and deprecated.php. In the deprecated file it says,
/** * Deprecated. Wrapper for <code>genesis_after_comment_form</code> action hook. * * @since 0.2.0 * @deprecated 1.7.0 */ function genesis_after_comment_form() { _deprecated_function( __FUNCTION__, '1.7.0', "do_action( 'genesis_after_comment_form' )" ); do_action( 'genesis_after_comment_form' ); }
So I don't see where the actual working code is for genesis_after_comment_form. It says do_action, but where is the description of the action to take place?
David BorrinkParticipantThank you, Victor. That was helpful. The article basically said that if you used them before, they'll show up in upgrades. That would explain why my wife's site carried them over into Genesis. So I know they'll show up when I activate the Genesis theme on my client's site.
And I answered my own question about how to put the blog roll in a page. I found a function code that shows how to add a shortcode to a page that will display the blogroll.
July 3, 2017 at 8:10 am in reply to: Amazon CPM ads not showing up in text widgets after WP 4.8, Genesis 2.5.2 update #208608David BorrinkParticipantThank you, Victor and Carasmo for your input. We'll check with Amazon. The more we looked at it, the more it seems it's an Amazon issue because it doesn't make sense.
-
AuthorPosts