dend359
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Displaying related post by certain tagHey guys, just in case anyone ever find this thread on Google, I was able to solve this problem.
Simply plug in [‘orderby’ => ‘rand’,] underneath ‘tag’ => ‘main’,
Forum: Fixing WordPress
In reply to: Displaying related post by certain tagHi guys, I was able to fix it!
Now my only question is, how do I randomize the tags?<?php $args=array( 'tag' => 'main', 'posts_per_page'=>4, // Number of related posts to display. 'caller_get_posts'=>1 ); $my_query = new wp_query( $args ); while( $my_query->have_posts() ) { $my_query->the_post(); ?> <div class="relatedthumb"> <a rel="external" href="<? the_permalink()?>"><?php the_post_thumbnail(array(300,200)); ?><br /> <?php the_title(); ?> </a> </div> <? } $post = $orig_post; wp_reset_query(); ?>
This is what I have
Forum: Themes and Templates
In reply to: Can't seem to customize caption fontYay that works! Thank you so much WPyogi!
Forum: Themes and Templates
In reply to: Can't seem to customize caption fontIt’s below the image.
Here’s the code to the single.php that displays the caption
<?php if ( $featured = get_the_post_thumbnail( get_the_ID() ) ): echo $featured; preg_match('/alt="(.*)"/i', $featured, $caption); if ($caption) { echo wpautop(array_pop($caption)); } endif; ?>
Forum: Themes and Templates
In reply to: Can't seem to customize caption fontI’m using a theme called simple grid. My sub website is this (where the problem lies): https://feeldriven.com/fitness/worst-burgers-for-your-health/3266/
Forum: Themes and Templates
In reply to: How to Customize Caption TextWow great, you are the main Alchymyth! This works perfectly, thank you so much!! ??
Forum: Themes and Templates
In reply to: How to Customize Caption TextOh hey Alchymyth, I remember you from a few months ago!
Here’s the link to the page as requested ??
https://saywhaa.com/health-and-fitness/mistakes-people-make-after-working-out/1989/
The theme doesn’t have the wp caption implemented. Here’s the CSS file as well: https://pastebin.com/SfK0dang
Forum: Fixing WordPress
In reply to: Previous/Next php responsive themes. (Code included)Hi there,
I’ve ran into another problem trying to wrap a border inside these floating objects. This is what I have added in my css file:
.navigationwrap { border: 2px solid #cfcfcf; box-shadow: 0px 5px 5px #888; padding: 9px; }
Then when I go to close it ( <div class=”navigationwrap”>My stuff</div>)
it doesn’t seem to show up.Am I doing something wrong here?
Forum: Fixing WordPress
In reply to: Show Post Counts Within Child CategoryEdit: nvm, I posted the wrong code and now I’ve lost my original code ??
I am still stuck.
[bump moderated – https://codex.www.ads-software.com/Forum_Welcome#No_Bumping ]
Forum: Fixing WordPress
In reply to: Previous/Next php responsive themes. (Code included)Thank you so much, this works wonder!
Also, I want to put it out there that you have to be careful when placing
.floatleft { float: left; } .floatright { float: right; } .clear { clear: both; }
in certain areas of your CSS files! I didn’t get it working at first because of putting this css style at places where it was in conflict with the others.
Forum: Fixing WordPress
In reply to: Doing If Else Statement if With is 800The theme is called Simple Grid, and it can be downloaded here:
https://www.dessign.net/simple-grid-theme-responsive/So by you saying that I can’t drop in a new variable, how would I approach this if else condition if the page is greater than 800px wide?
Forum: Fixing WordPress
In reply to: Doing If Else Statement if With is 800Where and how would I set my variable if I’m trying to depend on the width of the post? I thought it would be as simple as adding ‘width’ on there.
Forum: Fixing WordPress
In reply to: How to hide a post from the main page and category using a tagGreat!! Thanks a lot for your help Ryan, you’re awesome!
Forum: Fixing WordPress
In reply to: How to hide a post from the main page and category using a tagHi Ryan, that only makes the total post to 3. But I’ve figured it out!
I added this:
‘tag__not_in’ => array(‘6’); //6 is the tag ID for any WP newbie like myself
<?php $category_ID = get_category_id('blog'); $args = array( 'post_type' => 'post', //I added this simple code! 'tag__not_in' => array('6'), 'posts_per_page' => 12, 'cat' => '-' . $category_ID, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1) );
Now I have trouble excluding this tag in the category section!Any clue on that?
Here’s my category php
<?php get_header(); ?> <div id="load_posts_container"> <?php $x = 0; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; if($paged > 1) $y = (0 + (($paged-1) * 12)); else $y = 0; global $wp_query; $args = array_merge( $wp_query->query, array( 'posts_per_page' => 9 ) ); query_posts( $args ); while (have_posts()) : the_post(); ?> <?php if($x == 2) { ?> <div class="home_post_box home_post_box_last" onmouseover="show_post_desc(<?php echo $y; ?>)" onmouseout="hide_post_desc(<?php echo $y; ?>)"> <?php } else { ?> <div class="home_post_box" onmouseover="show_post_desc(<?php echo $y; ?>)" onmouseout="hide_post_desc(<?php echo $y; ?>)"> <?php } ?> <!--<img src="<?php bloginfo('stylesheet_directory'); ?>/images/blog-image.jpg" />--> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post',array('alt' => 'post image', 'class' => 'rounded')); ?></a> <div class="home_post_desc" id="home_post_desc<?php echo $y; ?>"> <?php $temp_arr_content = explode(" ",substr(strip_tags(get_the_content()),0,225)); $temp_arr_content[count($temp_arr_content)-1] = ""; $display_arr_content = implode(" ",$temp_arr_content); echo $display_arr_content . '...'; ?> </div><!--//home_post_desc--> <div class="home_post_title_cont"> <h3><?php the_title(); ?></h3> <h4><?php the_category(', '); ?></h4> </div><!--//home_post_title_cont--> </div><!--//home_post_box--> <?php if($x == 2) { $x = -1; /*echo '<div class="clear"></div>';*/ } ?> <?php $x++; $y++; ?> <?php endwhile; ?> <?php wp_reset_query(); ?> <div class="clear"></div> </div><!--//load_posts_container--> <div class="load_more_cont"> <p align="center"><span class="load_more_text"><?php next_posts_link('<img src="' . get_bloginfo('stylesheet_directory') . '/images/load-more-image.png" />') ?></span></p> </div><!--//load_more_cont--> <script type="text/javascript"> // Ajax-fetching "Load more posts" $('.load_more_cont a').live('click', function(e) { e.preventDefault(); //$(this).addClass('loading').text('Loading...'); //$('.load_more_text a').html('Loading...'); $.ajax({ type: "GET", url: $(this).attr('href') + '#main_container', dataType: "html", success: function(out) { result = $(out).find('#load_posts_container .home_post_box'); nextlink = $(out).find('.load_more_cont a').attr('href'); //alert(nextlink); //$('#boxes').append(result).masonry('appended', result); $('#load_posts_container').append(result); //$('.fetch a').removeClass('loading').text('Load more posts'); //$('.load_more_text a').html('Load More'); if (nextlink != undefined) { $('.load_more_cont a').attr('href', nextlink); } else { $('.load_more_cont').remove(); $('#load_posts_container').append('<div class="clear"></div>'); // $('.load_more_cont').css('visibilty','hidden'); } if (nextlink != undefined) { $.get(nextlink, function(data) { //alert(nextlink); if($(data + ":contains('home_post_box')") != '') { //alert('not found'); // $('.load_more_cont').remove(); $('#load_posts_container').append('<div class="clear"></div>'); } }); } } }); }); </script> <?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: How to hide a post from the main page and category using a tagWell I’ll be honest, I don’t know what I’m really doing since I’m not a programmer. I keep making the site go down. I’ll paste the code here to see if anyone can give me a lend.
<?php get_header(); ?> <div id="load_posts_container"> <?php $category_ID = get_category_id('blog'); $args = array( 'post_type' => 'post', 'posts_per_page' => 12, 'cat' => '-' . $category_ID, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1) ); query_posts($args); $x = 0; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; if($paged > 1) $y = (0 + (($paged-1) * 12)); else $y = 0; while (have_posts()) : the_post(); ?> <?php if($x == 2) { ?> <div class="home_post_box home_post_box_last" onmouseover="show_post_desc(<?php echo $y; ?>)" onmouseout="hide_post_desc(<?php echo $y; ?>)"> <?php } else { ?> <div class="home_post_box" onmouseover="show_post_desc(<?php echo $y; ?>)" onmouseout="hide_post_desc(<?php echo $y; ?>)"> <?php } ?> <!--<img src="<?php bloginfo('stylesheet_directory'); ?>/images/blog-image.jpg" />--> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post',array('alt' => 'post image', 'class' => 'rounded')); ?></a> <div class="home_post_desc" id="home_post_desc<?php echo $y; ?>"> <?php $temp_arr_content = explode(" ",substr(strip_tags(get_the_content()),0,225)); $temp_arr_content[count($temp_arr_content)-1] = ""; $display_arr_content = implode(" ",$temp_arr_content); echo $display_arr_content . '...'; ?> </div><!--//home_post_desc--> <div class="home_post_title_cont"> <h3><?php the_title(); ?></h3> <h4><?php the_category(', '); ?></h4> </div><!--//home_post_title_cont--> </div><!--//home_post_box--> <?php if($x == 2) { $x = -1; /*echo '<div class="clear"></div>';*/ } ?> <?php $x++; $y++; ?> <?php endwhile; ?> <?php wp_reset_query(); ?> <div class="clear"></div> </div><!--//load_posts_container--> <div class="load_more_cont"> <p align="center"><span class="load_more_text"><?php next_posts_link('<img src="' . get_bloginfo('stylesheet_directory') . '/images/load-more-image.png" />') ?></span></p> </div><!--//load_more_cont--> <script type="text/javascript"> // Ajax-fetching "Load more posts" $('.load_more_cont a').live('click', function(e) { e.preventDefault(); //$(this).addClass('loading').text('Loading...'); //$('.load_more_text a').html('Loading...'); $.ajax({ type: "GET", url: $(this).attr('href') + '#main_container', dataType: "html", success: function(out) { result = $(out).find('#load_posts_container .home_post_box'); nextlink = $(out).find('.load_more_cont a').attr('href'); //alert(nextlink); //$('#boxes').append(result).masonry('appended', result); $('#load_posts_container').append(result); //$('.fetch a').removeClass('loading').text('Load more posts'); //$('.load_more_text a').html('Load More'); if (nextlink != undefined) { $('.load_more_cont a').attr('href', nextlink); } else { $('.load_more_cont').remove(); $('#load_posts_container').append('<div class="clear"></div>'); // $('.load_more_cont').css('visibilty','hidden'); } if (nextlink != undefined) { $.get(nextlink, function(data) { //alert(nextlink); if($(data + ":contains('home_post_box')") != '') { //alert('not found'); // $('.load_more_cont').remove(); $('#load_posts_container').append('<div class="clear"></div>'); } }); } } }); }); </script> <?php get_footer(); ?>