clarkdprice
Forum Replies Created
-
Sure. The this https://weldingschool.com
The pages that I am trying to remove are below, post ids can me seen in my OP:
https://www.weldingschool.com/twsh/
https://www.weldingschool.com/twsj/
https://www.weldingschool.com/twst/Here is the rawcode for the recommendation engine
/* Create shortcode for displaying related posts anywhere in the post */ function labnol_related_shortcode( $atts ) { $related_posts = ""; if ( class_exists( 'Jetpack_RelatedPosts' ) && method_exists( 'Jetpack_RelatedPosts', 'init_raw' ) ) { $related = Jetpack_RelatedPosts::init_raw() ->set_query_name( 'jetpackme-shortcode' ) ->get_for_post_id( get_the_ID(), array( 'size' => 3 ) // How many related posts? ); if ( $related ) { foreach ( $related as $result ) { $related_post = get_post( $result[ 'id' ] ); $url = get_permalink($related_post->ID); $title = $related_post->post_title; $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $related_post->ID ), 'single-post-thumbnail' ); if ($thumbnail != '') { $related_posts .= "<li><a href='" . $url . "'><figure style='height: 111px; background-image: url(". $thumbnail[0] ."); background-size: cover;' class='full-image attachment-related-small' scale='0'></figure></a><h4><a class='related-link' href='" . $url . "'>$title</a></h4></li>"; } else { $related_posts .= "<li><a href='" . $url . "'><figure style='height: 111px; background-image: url(/wp-content/uploads/2015/02/banner-weld7.jpg); background-size: cover;' class='full-image attachment-related-small' scale='0'></figure></a><h4><a class='related-link' href='" . $url . "'>$title</a></h4></li>"; } } $related_posts = '<ul>' . $related_posts . '</ull>'; } } return $related_posts; } /* Create a new shortcode for Jetpack related posts */ add_shortcode( 'labnol_related', 'labnol_related_shortcode' );
Forum: Plugins
In reply to: [Contextly Recommends] Siderail an dMain module on one page.https://wparsenal.staging.wpengine.com/blog/save-money-on-halloween-decor
I’m running this on a staging site. The link above is is a blog post where they would need to appear. I need the posts to appear at the bottom and on the sidebar. I tried the context siderail widget first, which did not work. Now I’m using an enhanced text widget with this code inside of it:
<div class=”ctx-siderail-container”>[contextly_siderail]</div>
figured this out, used this:
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $related_post->ID ), ‘thumbnail’ );
I resolved this myself. Updating this in the settings did not work and I wasted a bunch of time trying to figure out why. I discovered that the actual widget also has settings to sort the post types. Setting to only show blog posts worked here. I’m fairly new to WordPress so maybe this would have been easier to resolve if I knew the system better, however, this functionality is confusing.
I did that. Posts is the only thing thats checked, but everything is appearing still.