Forum Replies Created

Viewing 15 replies - 1 through 15 (of 39 total)
  • Thread Starter juicyjuke

    (@juicyjuke)

    Some pages will have 4 different categoroy posts but the categories will have posts from their category

    Thanks, I understand how to manually create buttons. What I’m trying to do is edit the query posts display posts as buttons so I dont have to manually go in myself and do it.

    If I can just figure out how to properly edit the

    Wp_Query

    To display the post title link in the form of a buttons. A real button. Then ill be happy

    Thread Starter juicyjuke

    (@juicyjuke)

    For example, instead of seeing a list of posts , and their features image when they enter a category, I would rather see an alphabetical list of post links in the form of buttons so they can just scroll down the ordered list of posts

    Example:
    Category : rooftop units

    Description: troubleshooting Electrical parts for rooftop package units

    Page content
    Scroll the alphabetical list for the parts you need information on

    Aon Controls
    Anvil Capacitors
    Anvil ignition boards
    Branch Operator Controls

    Thread Starter juicyjuke

    (@juicyjuke)

    ok im closing this. thanks again

    Thread Starter juicyjuke

    (@juicyjuke)

    hmm. ok! thanks

    Thread Starter juicyjuke

    (@juicyjuke)

    Thanks, that tutorial is instructing me how to prevent duplicate images in a post.

    I’m trying to prevent an image from being used again once it’s been used once

    Thread Starter juicyjuke

    (@juicyjuke)

    That works! Week of researching and I get answered in 2 seconds on this forum.

    Having “rewriteEngine On”. Twice is ok? I was reading that wasn’t good but I don’t understand why

    Thread Starter juicyjuke

    (@juicyjuke)

    So basically instead of the video playing when clicked…I want it to open up to the post page..only then the video will play when clicked .

    Thread Starter juicyjuke

    (@juicyjuke)

    Yes a tiny representation of the content. Sorry I should of specified a bit more. Specifically I wanted this for video content.

    A thumbnail of the video content, when clicked I wanted it to open up to the post page of the video instead of the video playing .

    Thread Starter juicyjuke

    (@juicyjuke)

    Ok great. I will seek them out. Thanks for the advice.

    What I meant? Ok as in. Does the shortcode I created do things how WordPress normally does them. Using the proper functions etc etc.

    Thread Starter juicyjuke

    (@juicyjuke)

    Thumbnail of post content

    Thread Starter juicyjuke

    (@juicyjuke)

    ok check it out.

    Pagination works!!

    One thing id like to know however. Is this within the rules of wordpress? Like. is think ok for wordpress site?

    add_filter( 'category_description', 'do_shortcode'); 
    
    function wpb_postsbycategory($atts) {
    	extract( shortcode_atts( array(
    		'expand' => '',
    	), $atts) );
        global $paged;
        if ( get_query_var('paged') ) {
        $paged = get_query_var('paged');
        } else if ( get_query_var('page') ) {
        $paged = get_query_var('page');
        } else {
        $paged = 1;
        }
        $posts_per_page = 10;
        $settings = array(
            'showposts' => $posts_per_page, 
            'post_type' => 'post', 
            'category_name' => 'crazy-humorous-pictures, strange-news-stories, crazy-humorous-videos, crazy-funny-memes',
            'orderby' => 'menu_order', 
            'order' => 'DESC', 
            'paged' => $paged
        );
    	
        $post_query = new WP_Query( $settings );	
        
        $total_found_posts = $post_query->found_posts;
        $total_page = ceil($total_found_posts / $posts_per_page);
    		
    	$list = '<ul class="postsbycategory widget_recent_entries">';
    	while($post_query->have_posts()) : $post_query->the_post();
    		if ( has_post_thumbnail() ) {
    			$list .= '<a href="' . get_the_permalink() .'" rel="bookmark">' . get_the_title() . '</a></li>';
    			$list .= '<li>';
    			$list .= '<a href="' . get_the_permalink() .'" rel="bookmark">' . get_the_post_thumbnail($post_id, array( 500, 500) ) . '</a></li>';
                            } else {
    			// if no featured image is found
    			$list .= '<li><a href="' . get_the_permalink() .'" rel="bookmark">' . get_the_title() .'</a></li>';
    			$list .= '<li> '. get_the_content() .'</li>';
    			}   
    	endwhile;
    	$list.= '</ul>';
        
        if(function_exists('wp_pagenavi')) {
            $list .='<div class="page-navigation">'.wp_pagenavi(array('query' => $post_query, 'echo' => false)).'</div>';
        } else {
            $list.='
            <span class="prev-posts-links">'.get_previous_posts_link('<< Previous ').'</span>
            <span class="next-posts-links">'.get_next_posts_link(' Next >>', $total_page).'</span>
            ';
        }
        
    	
    	return $list;
       
    
    }
    
     
    
    // Add a shortcode
    add_shortcode('categoryposts', 'wpb_postsbycategory');
    
    // Enable shortcodes in text widgets
    add_filter('widget_text', 'do_shortcode');
    Thread Starter juicyjuke

    (@juicyjuke)

    Yes ok. Turn it into a function then call that function my desired page/s php file. Ok that makes sense now.

    Also …

    Be sure the wp-config.php of your test install has WP_DEBUG defined as true.

    I know you have your own theme, but to avoid possible conflicts, your test installation should use the twentysixteen theme (or in general one theme earlier than the latest default theme) and no plugins. Setup a child theme of twentysixteen

    Ok I have done most of this . WP debug to see if it’s true however I have not. I have not used twenty 16 as a test. Will underscores be just as good to test?

    Also I may have not explained. Somewhere in the middle of my theme creating I added Bootstrap . Personally that might of been a mistake as it just adds for things for me to know lol

    Thread Starter juicyjuke

    (@juicyjuke)

    makes all sense what you said. its just learning how to do it again. I started following a 24 part build your theme from scratch tutorial, and after the 7th lesson I got what I needed and went on from there. ive got work in between. what I need is a good book to knock it all into my head again. like even VB I forgot. at least I understand what things do. any suggestions on what to read in order to implement what you said? or maybe even send you a zip of all my code? id be willing to compensate for your time. email? I don’t have a whole bunch of code. very simple. well for someone like you at least.

    its hard to explain how I know what I know already without understanding exactly how to do what you said. I find myself doing some things that require good experience yet not being able to do things that a beginner can do.
    make sense?

    • This reply was modified 9 years, 1 month ago by juicyjuke.
    • This reply was modified 9 years, 1 month ago by juicyjuke.
    Thread Starter juicyjuke

    (@juicyjuke)

    In case you’ve not done so, unless you’ve built your own theme, you should create a child theme to contain all of your custom work. Otherwise your work will be lost when a theme is updated.

    Yes I have other content. Under the main header nav I have 4 categories showing the latest featured image from each category in a row. I have built it from scratch. well using tutorials etc. However Im afraid my main problem here is understanding programming again, and foremost. learning wordpress functions and what they do. I might need to pick up a good book. I used to code basic, VB, vb-scriot, html when I was 14-16 using anglefire. but..i haven’t done anything since. now its over 20 years later. lmao.

    • This reply was modified 9 years, 1 month ago by juicyjuke.
    Thread Starter juicyjuke

    (@juicyjuke)

    so basically I have to start from scratch. I need the latest posts from 4 categories to be displayed on my home page.

    10 per page, and then paginated. I want everyone to be able to find a post that’s interesting instead of manually going to each category one at time to find something interesting.

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