Safeer
Forum Replies Created
-
Please try this in your functions.php
function cp_product_widget() { global $woocommerce; $items = $woocommerce->cart->get_cart(); foreach($items as $item ) { $incart[] = $item['product_id']; } $query_args = array( 'posts_per_page' => 5, 'post_status' => 'publish', 'post_type' => 'product', 'no_found_rows' => 1, 'order' => 'asc', 'post__not_in' => $incart ); $r = new WP_Query( $query_args ); if ( $r->have_posts() ) { echo '<ul class="product_list_widget">'; while ( $r->have_posts()) { $r->the_post(); wc_get_template( 'content-widget-product.php', array( 'show_rating' => $show_rating ) ); } echo '</ul>'; } }
Now add
<?php cp_product_widget(); ?>
in a php text widget
https://www.ads-software.com/plugins/php-code-widget/Forum: Fixing WordPress
In reply to: Cannot find where to set default value for "Show Related Posts"Hi,
That will depend on the theme you are using, default theme does not have related posts as of I know.
Please check these plugins
https://www.ads-software.com/plugins/yet-another-related-posts-plugin
https://www.ads-software.com/plugins/wordpress-23-related-posts-pluginForum: Fixing WordPress
In reply to: add related posts to single pagePlease try this
$args = array( 'post_type' => 'product', 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 4, 'post__not_in' => array($post->ID) ); $related = get_posts( $args ); if( $related ) foreach( $related as $post ) { setup_postdata($post); ?> <div class="col-md-3"> <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> <?php the_content('Read the rest of this entry »'); ?> </div> <?php } wp_reset_postdata();
Let me know if it works
Forum: Plugins
In reply to: [WooCommerce] Home Page blank – PLEASE HELP!!!!Enable debug mode and check for errors
https://codex.www.ads-software.com/Debugging_in_WordPressTry with a different theme
Try increasing memory limit in wp-config.phpdefine('WP_MEMORY_LIMIT', '128M');
Forum: Plugins
In reply to: [WooCommerce] remove links from product titlesPlease refer to ../woocommerce/templates/content-product.php and remove the a href link there.
You can override templates this way
https://docs.woothemes.com/document/template-structure/Forum: Fixing WordPress
In reply to: images still pointing to localhostYou may need to try the Velvet Blues Update URLs plugin
https://www.ads-software.com/plugins/velvet-blues-update-urlsForum: Fixing WordPress
In reply to: How to Link/Embed WP Latest Post to other websitesThere is no such thing like
echo ('css/style.css');
Consider that you page is a default php page and you can include stylesheet as usual. It would be good to google and get some basics ??
Forum: Fixing WordPress
In reply to: How to Link/Embed WP Latest Post to other websitesIts a basic php error and you will get plenty articles on it
Forum: Fixing WordPress
In reply to: Broken searchboxCheck if search works with a default theme, check your search.php file
custom CSS will differe from theme to theme, inspect the element with browser developer tool and find the proper css class and add custom css.
https://vimeo.com/20917974
https://developers.google.com/chrome-developer-tools/Try this code
.blog_post_meta { display: none; }
Forum: Fixing WordPress
In reply to: Category for blog showing 404Hi,
1)Try resetting your permalinks.
2)Check if it works with default permalinks structure
3)Deactivate all plugins and reset permalinks again
4)Check if it works with a default themeForum: Fixing WordPress
In reply to: How to remove the word "archive" from category archive titleHi Olly,
It will depends on the theme you are using, in twentytwelve you can edit it category.php
You can search for the string in entire folder using editor like Notepad++
Forum: Fixing WordPress
In reply to: How to Link/Embed WP Latest Post to other websitesYou will need to chnage the html file to php and try like this
// Include the wp-load’er
include(‘news/wp-load.php);// Get last 10 posts
// Returns posts as arrays instead of get_posts’ objects
$recent_posts = wp_get_recent_posts(array(
‘numberposts’ => 10
));// list post
echo ‘- ‘;
- ‘, $post[‘post_title’], ‘
foreach($recent_posts as $post) {
echo ‘‘;
}
echo ‘‘;
Forum: Fixing WordPress
In reply to: Posts on homepageYou may need to set your home as single post for this
It require a custom page template witha custom query to call the single post
The template can really be a copy of index.php, or one of your other templates with the header on it
https://codex.www.ads-software.com/Pages#Page_TemplatesThen a query calling to the one post
https://codex.www.ads-software.com/Function_Reference/query_postsor possibly just adding a query to index.php wrapped in a conditional
https://codex.www.ads-software.com/Function_Reference/is_front_page
https://codex.www.ads-software.com/Conditional_TagsForum: Fixing WordPress
In reply to: wp-admin not workingThe error is from your theme file, and need troubleshoot to know the exact issue.
It also seem like theme folder is in wrong location, it supposed to be like
themes/marble/functions.phpIf you are using a premium theme please check with theme developer.