Forum Replies Created

Viewing 15 replies - 16 through 30 (of 30 total)
  • Gregor

    (@vaderw)

    Try changing the line

    'orderby' => 'meta_value_num',

    to

    'orderby' => 'meta_value meta_value_num',

    This has worked for others?

    Gregor

    (@vaderw)

    No problem, I thought that might have been the case – glad you’re working again. If you need any more help just shout!

    Gregor

    (@vaderw)

    Sorry – just seen the last line of your post please ignore this post! ??

    Gregor

    (@vaderw)

    Hi ironman,

    Can you post your full code please?

    At a quick glance I notice that the value of ‘meta_query’ => array( array( <values> ) ) – I’d say this should only be a single array rather than having it nested, one within another.

    This would be the first attempt I’d make, but without seeing how $values is being used I can’t say for sure! ??

    $values = array(
      'numberposts' => 10,
      'orderby' => 'meta_value_num',
      'meta_key' => 'count_views',
      'meta_query' => array(
          'key'     => 'slider',
          'compare' => '!=',
          'value'   => ''
      )
    );
    Gregor

    (@vaderw)

    Looks like when the if statements are true, you query_posts twice, duplicating the posts. To get around this move the orderby=rand into the $args array, adjust the second query_posts() to use this array in it’s query, and remove the first query_posts() completely.

    So try…

    <?php if(of_get_option('frontcat_checkbox') == "1"){ ?>
    <?php if(is_front_page()) {
    // This sets the values of $args if the above both return true
    	 $args = array(
    				   'cat' => ''.$os_front = of_get_option('front_cat').'',
    				   'post_type' => 'post',
    				   'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),
    				   'posts_per_page' => ''.$os_fonts = of_get_option('frontnum_select').'',
    				   'orderby' => 'rand');
    } ?>
    <?php }?>
    
     <?php
    // query_posts() occurs once, returning one set of posts matching the values of $args
    query_posts($args); ?>
    
    <?php
    if(have_posts()):
    // If we have the posts, display them ?>
    <?php while(have_posts()): ?>
    <?php the_post(); ?>
    <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
    Gregor

    (@vaderw)

    Hi Jeanne, if you’d like me to check it out drop me an email with the login details and we’ll get you up and running, and post the results back here for future reference. I’ll be about for the next couple of hours ??

    Gregor

    (@vaderw)

    Don’t worry Jeanne – we’ll get there! Do you want me to login to take a look?

    Gregor

    (@vaderw)

    Okay so when you edit the post, make sure you are in ‘Visual’ mode rather than ‘Text’ (top left tabs of the edit box.

    Select the text that you want to link so that it is highlighted (click and drag over the word).

    Click the ‘insert link’ icon on the toolbar (looks like a chain link).

    In the URL text box enter your target address (https://community.honestbuildings.com/spotlight-sdgfp-outdoor-campus/ without brackets of course)

    Leave title, and lower half as is, and click ‘Add link’.

    This should work, if not come back with what it does/doesn’t do – or perhaps update the post after going through these steps so I can see the code on your live page and I could take it further.

    Gregor

    (@vaderw)

    Thanks and the page address you’re trying to link “here” to?

    Gregor

    (@vaderw)

    Understood, can you post the entire code of the file containing the query_posts as described above?

    Gregor

    (@vaderw)

    Hi imon,

    How do you want to change what’s displayed?

    Do you want a certain number of posts, posts only from one category, posts with a certain tag…?

    Thanks

    VW

    Gregor

    (@vaderw)

    Hi Jeanne,

    What text are you trying to link and what is the address of the page you’re trying to link it to?

    Thanks

    VW

    Gregor

    (@vaderw)

    Hi Maviefol,

    Can give us a file list of what’s in both your parent and child theme please?

    Also, check that you have a style.css file in both the parent and child folders.

    Thanks

    VW

    Gregor

    (@vaderw)

    No problem, if you have any more questions just shout! ??

    Gregor

    (@vaderw)

    Hi Midwestsole,

    Try adding this code to your CSS, basically hides all view counts with CSS.

    .entry-meta span.post-views{ display: none;}
    .entry-meta span.sep:last-of-type { display: none;}

    (last-of-type which removes the associated seperator is compatible with Chrome, Safari 3.2+, Firefox, Opera9.5+, IE 9+, Android and iOS)

    You could also go into your theme and remove it from there permanently but this isn’t ideal if you plan on upgrading a purchased theme in the future. Another avenue would be to remove it with your functions.php file.

    Let me know if it works!

    VW

Viewing 15 replies - 16 through 30 (of 30 total)