babyuniverse
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Storefront] CSS HelpI made the changes to https://www.simonjohnson.com/wp-content/themes/storefront-child/style.css?ver=1.0
I have now also updated the cache. It still doesnt look right
Forum: Themes and Templates
In reply to: [Storefront] CSS HelpThanks for your reply. On the mobile site I would like the text followed by the region and quantity an then the image.
The mobile menu I would just like it be visible. Maybe a white background. Currently I cannot see the menu.
Thanks
RichardForum: Themes and Templates
In reply to: [Storefront] LogoThat’s awesome thanks mate.
For some reason the logo also looks big on mobile. It was fine before a recent update.Any ideas on that?
Forum: Fixing WordPress
In reply to: Sort by TaxonomyForum: Fixing WordPress
In reply to: Sort by TaxonomyHi all,
I have changed by set-up slightly to have 2 separate post types “Premium Listing” and “Free Listing” and a taxonomy for Listing_category.
Here is an example of my Loop (without the HTML)
The idea is to display Premium listings followed by Free listings on the archive page of my taxonomy.This seems to work however when I add it to my taxonomy_listing_category.php I get results that are not specific to my taxonomy.
For instance https://www.domain.com/listing_category/carriers/ should show 1 Premium and then Free listings with taxonomy Carriers, however it shows all taxonomies.
The code is below
[ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]
<?php $args = array( 'post_type' => 'premium_listing', 'orderby' => 'rand', ); $the_query = new WP_Query( $args ); ?> <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php the_title(); ?> <?php endwhile; else: ?> <?php get_template_part( 'inc/posts/post-404' );?> <?php endif; ?> <?php rewind_posts(); ?> <?php $args = array( 'post_type' => 'free_listings', 'post_per_page' => 1, 'orderby' => 'rand', ); $the_query = new WP_Query( $args );?> <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php the_title() ;?> <?php endwhile; else: ?> <p>Sorry, there are no posts to display</p> <?php endif; ?>
My theme doesnt have an archive.php so I have used the index.php as the basis for creating taxonomy_listing_category.php
Any ideas Richard.
Richard
Forum: Fixing WordPress
In reply to: Sort by TaxonomyHi,
Thanks, yes I mean show the paid listings in a random order, I have seen a few plugins that do this but was trying to replicate in my loop
Thanks
RichardForum: Fixing WordPress
In reply to: Show Posts on a PageSorry I dont think I explained myself very well
the code below is currently on my site and working fine.
<?php
if( is_page(‘376’) ) query_posts(‘cat=23’);
elseif( is_page(‘389’) ) query_posts(‘cat=44’);
elseif( is_page(‘396’) ) query_posts(‘cat=65’);
elseif( is_page(‘397’) ) query_posts(‘cat=66’);
?>I was trying to create a seperate if statement something along the lines of
<?php
if ( is_page(‘376’) ) echo GeoMashup::map(1);
elseif( is_page(‘389’) ) echo GeoMashup::map(2);
elseif( is_page(‘396’) ) echo GeoMashup::map(3);
elseif( is_page(‘397’) ) echo GeoMashup::map(4);
?>But I cannot get it to work – what am I missing?
The code I need to run is <?php echo GeoMashup::map(1); ?> but I assume I cannot use the <?php tag within another php tag which is why I dropped it above.Thanks again
RichardForum: Fixing WordPress
In reply to: Show Posts on a PageHi,
Any idea on this?
Forum: Fixing WordPress
In reply to: Show Posts on a Pageedit
Forum: Fixing WordPress
In reply to: Show Posts on a PageHi All,
Thanks this is now working, I wiould now like to use a similar if and elseif statement for adding some PHP code instead of the query post
The code I require is <?php echo GeoMashup::map(); ?> this will add a map depending on what page is showing.
Thanks again
RichardForum: Fixing WordPress
In reply to: Show Posts on a PageThanks – That doesnt seem to work, it doesnt return any posts
Should it be if($page_id == ‘389’) or if($page_id == 389)My latest code is as follows and it is showing no posts.
<?php
if ($page_id==376){
query_posts(‘cat=23’);
};
if ($page_id==389){
query_posts(‘cat=44’);
};
if ($page_id==396){
query_posts(‘cat=65’);
};
if ($page_id==397){
query_posts(‘cat=66’);
};EDIT – it works by adding just the query_posts and manually selecting the category, the if statement isnt workinh though
Thanks
RichardForum: Plugins
In reply to: display random posts on index page<?php
global $wpdb;
$numposts = 1;
$rand_posts = $wpdb->get_results(“SELECT * FROM $wpdb->post2cat,$wpdb->posts,$wpdb->categories WHERE
$wpdb->post2cat.post_id = $wpdb->posts.ID and $wpdb->post2cat.category_id = $wpdb->categories.cat_ID and $wpdb->posts.post_status = ‘publish’ and $wpdb->categories.cat_name = ‘featured’ ORDER BY RAND() LIMIT $numposts”);
foreach($rand_posts as $post) :
setup_postdata($post);
?>Hi Everyone, this code works find and I am now getting random posts for category “featured”
How do I take this one step further and show random post from whichever category im currently in?
Now if I click on another category other than featured i still get the ramdom posts from featured.
On home page it would show randon form every category, and when in a category it would show category specific