Forum Replies Created

Viewing 15 replies - 1 through 15 (of 752 total)
  • YES! I recently did an audit and noticed that my site (which is forced SSL) had breadcrumb links that were not https:! Wish there was a way to make sure that the links were https: I will use the function left by Daniel until this is fixed.

    On the page you sent there is alt text on the image already. What exactly is the issue you are having?

    If you are using Gutenberg there is already this information just 1 click away. In the top left corner is a little information button (content structure) which will show you information about the block content you have below.

    Why not use this?

    Normally the functions.php file is the place to go to change core stuff about your theme, but in this case you may want to search your ‘comments.php’ file. Around line 73 you will find:

    comment_form( array(
        'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
        'title_reply_after'  => '</h2>',
    ) );

    just add your code so it looks like this:

    comment_form( array(
        'title_reply_before' => '<h2 id="reply-title" class="comment-reply-title">',
        'title_reply_after'  => '</h2>',
        'label_submit'=>'Have Your Say',
    ) );

    however, if I were you I would look into creating a child theme before you made any changes to your existing theme. It’s very easy and will save you a ton of headache in the future! (especially if your theme is updated)

    If you have a place to add custom CSS try this:

    header nav {
        display: none;
    }

    should take care of both.

    So this is in your header file? I take it that it comes BEFORE your loop then. Try passing the ‘$post->ID’ variable into a different function ‘get_the_post_thumbnail()’ like this:

    <?php do_action('sydney_after_header'); ?>
    
    	<div class="sydney-hero-area">
    		<?php sydney_slider_template(); ?>
    		<div class="header-image">
    			<?php sydney_header_overlay(); ?>     
    
        		<img class="header-inner" src="<?php if( has_post_thumbnail($post->ID) ) { echo get_the_post_thumbnail($post->ID); } else { header_image(); } ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>">
    			
    		</div>
    		<?php sydney_header_video(); ?>

    and see if that does anything. You should also inspect your code in your browser to see what gets output each time. it helps troubleshoot things like this.

    • This reply was modified 6 years, 8 months ago by Mr Case.
    • This reply was modified 6 years, 8 months ago by bcworkz. Reason: code fixed

    Is this line of code inside your loop? if so maybe you don’t need ‘$post_id’. and also, I don’t think ‘$post_id’ is a core global variable…I could be wrong though. So if your code is outside the loop maybe try ‘$post->ID’ instead?

    ok. it seems you are using a plugin called PODS. I would recommend looking at their documentation as they may have specific functions that may help you better.

    https://pods.io/docs/code

    Ok. I looked a little longer at what I think you are trying to do.

    Get all post from custom post type ‘activity’ that HAVE a post meta value?

    Maybe just change the values of your query first?

    <?php
    
    $args = array(
       'post_type' => 'activity',
       'posts_per_page'=>'-1',
       'meta_key' => 'activities_label',
       'compare' => 'EXISTS'
    );
    
    $query = new WP_Query($args);
    
    while($query->have_posts()) :
    	$query->the_post();
    	$activities_label = get_post_meta(get_the_id(), 'activities_label', true);
    
    	echo "<br>".get_the_title()."<br>".$activities_label."<br><br>";
    
    endwhile;

    Its hard to tell what you have going on so everything I say here is just a wild guess. My next guess would be to remove your conditional statement, for testing purposes, just to make sure something is getting echoed.

    $activities = get_post_meta(get_the_ID(), "activities", false);
    $ids = array_column($activities, 'ID');
    
    $args = array(
       'post_type' => 'activity',
       'posts_per_page'=>'-1',
       'post__in' => $ids,
       'orderby' => 'post__in',
    );
    
    $query = new WP_Query($args);
    
    while($query->have_posts()) :
    	$query->the_post();
    	$activities_label = get_post_meta(get_the_id(), 'activities_label', true);
    
    	echo "<br>".get_the_title()."<br>".$activities_label."<br><br>";
    
    endwhile;

    please show me what happens with that.

    maybe move the ‘activities_label’ variable INSIDE the loop?

    $activities = get_post_meta(get_the_ID(), "activities", false);
    $ids = array_column($activities, 'ID');
    
    $args = array(
       'post_type' => 'activity',
       'posts_per_page'=>'-1',
       'post__in' => $ids,
       'orderby' => 'post__in',
    );
    
    $query = new WP_Query($args);
    
    while($query->have_posts()) :
    	$query->the_post();
    	$activities_label = get_post_meta(get_the_id(), 'activities_label', true);
    
    	echo "<br>".get_the_title();
       
    	if (strpos($activities_label, "\n") !== false || false !== strstr($activities_label, PHP_EOL)) {
    		echo "<br>".$activities_label."<br><br>";   
    	}
    endwhile;

    can you try this? just switched one of the functions and changed the logical operator.

    $activities_label = get_post_meta(get_the_ID(), 'activities_label', true);
    
    while ($query->have_posts()) { 
    	if (strpos($activities_label, "\n") !== false || false !== strstr($activities_label, PHP_EOL)) {
    	  echo $activities_label;
    	}
    }

    and sorry, but i’m and old fashioned curly brackets kind of guy, not one of those new line, curly brackets guys though…those guys are weird

    you say “custom shortcodes” i take it you wrote some custom functions? possibly in your functions.php file? can you share the code for your “custom shortcodes”?

    Off the top of my head I do not know of any plugins, but Google offers their Google Charts service for free. With a custom form, some custom javascript and the Google charts you could accomplish this.

    Qual é o URL do seu site? Com qual página ou páginas você tem problemas? Que parte da página está causando problemas?

Viewing 15 replies - 1 through 15 (of 752 total)