Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Never mind – I figured it out. It came from the “CopyNShare” option in my ShareThis widget. The extra hashtag allows the plugin to track when people copy and share my links.

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Yes, that definitely worked. Thank you again, so much. I have been struggling with this for weeks!

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    I spoke too soon. I was so excited that it showed “previous” and “next” links, but didn’t realize that when I click on “next,” it basically refreshes the page and adds “previous” to it. It doesn’t actually pull the next page of posts: https://hrc.wastateleg.org/news/. I pasted in your code above, I only changed the “cat” number, because it was supposed be 7 and not 1.
    Sorry, can you help me again??

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    It worked!!!! I cannot thank you enough! Thank you so much Sakin!!

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Any ideas out there? I am still looking…

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Ok I tried the ‘paged’ line you suggested, as well as the max num pages suggested on the link you provided. The large code replacement suggested on that page doesn’t exactly work with what I have in my code, so I didn’t know how to translate it to my code.
    Here’s my entire php template file:

    <?php
    
    /**
    * Template Name: Newsroom
    * The newsroom template file.
    * This is the template file used for displaying the main newsroom page.
    * @package Catch Themes
    * @subpackage Catch_Box
    */
    
    get_header(); ?>
    </div><!-- site-logo -->
    
    <div id="content100" div style="text-align:left;">
    <h1 class="entry-title">Newsroom <hr></h1>
    
    <?php if ( have_posts() ) : ?>
    
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    <div><?php dynamic_sidebar('Opinions'); ?></div>
    <div style="padding: 0.1em 0% 3em;">				
    
    <?php
        $args=array(
    		'cat' => 7,
    		'orderby' =>'post_date',
    		'order' => 'DESC',
    		'posts_per_page' => 10,
    		'paged' => get_query_var('page')
        );
    $my_query = new WP_Query($args);
    
        if( $my_query->have_posts() ) {
    
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
            <br /><strong><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a the_title_attribute(); ?></a></strong>
    <div style="text-align:right;"><em><?php echo get_the_date(); ?></em></div>
    <?php the_excerpt(); ?></p>
    
       <?php
          endwhile;
        } //if ($my_query)
      wp_reset_query();  // Restore global post data stomped by the_post().
    ?>
    </div><!-- extra padding -->
    
    <?php next_posts_link(); ?> 
    
    				<?php endwhile; ?>
    
    			<?php else : ?>
    
    				<article id="post-0" class="post no-results not-found">
    					<header class="entry-header">
    						<?php _e( 'Nothing Found', 'catchbox' ); ?>
    					</header><!-- .entry-header -->
    
    					<div class="entry-content">
    						<h1 class="entry-title"><p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'catchbox' ); ?></p></h1>
    						<?php get_search_form(); ?>
    					</div><!-- .entry-content -->
    				</article><!-- #post-0 -->
    
    			<?php endif; ?>
    
    </div><!-- #content100 -->
    
    <?php previous_posts_link(); ?><?php next_posts_link(); ?> 
    
    		</div><!-- #primary -->
    <?php get_footer(); ?>

    I appreciate your help!!

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    I see what you mean – though the link you provided had two queries and two endwhile lines.
    I tried:
    -adding the reset code down to the second endwhile and got an error for my template (unexpected T_ENDWHILE)
    -deleted the second endwhile and got an error (unexpected T_ELSE)
    -moved the <?php previous_posts_link(); ?><?php next_posts_link(); ?> above the first endwhile and got no links (but didn’t get an error)

    I’m very new to WordPress and the Loop as well; I’m really playing a puzzle blind at this point…

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Seacoast – I’m trying to avoid more plugins, but if it comes down to it I will check that one out, thank you!

    Alchymyth – I tried <?php previous_posts_link(); ?><?php next_posts_link(); ?> before and after the <?php endwhile; ?> and neither worked (displayed nothing). From that page you linked, I found <?php echo get_previous_posts_link(); ?><?php echo get_next_posts_link(); ?> but those also displayed nothing (again, tried placing before then after the <?php endwhile; ?>).

    Still stumped…

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    I found Advanced Custom Fields plugin. Any non-plugin solutions so I don’t bog down my site with too many plugins?

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    cue >angelic voices<
    Hooray! Thank you so much!! I really appreciate it!!

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    I’m not getting an error, the page is displaying, but it’s not pulling the feed it should be. The custom field being pulled, “delicious-feed” is this: https://feeds.delicious.com/v2/rss/wahousegop/alexander. So there are two stories that should be pulling the area “In the News” on the Web page and it’s not.

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Ooops sorry I made it public. Never used paste pin before.

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Ok didn’t work. I pasted it here: https://pastebin.com/2zjRP0ze.
    Thank you for your help!!

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Hmmm didn’t help. Error this time:
    ” Parse error: syntax error, unexpected ‘{‘ in /home/hrcadmin/public_html/wp-content/themes/catch-box-child/member.php on line 126″

    Thread Starter hrcwebmaster

    (@hrcwebmaster)

    Ok I tried it this way

    $rss = fetch_feed('<?php $key="delicious-feed"; echo get_post_meta($post->ID,$key,true); ?>'); {
    global  $post
    if (!is_wp_error( $rss ) ) : }
    // Checks that the object is created correctly
        // Figure out how many total items there are, but limit it to 5.
        $maxitems = $rss->get_item_quantity(5);

    and it gets error ” Parse error: syntax error, unexpected T_IF, expecting ‘,’ or ‘;’ in /home/…”
    and this way

    $rss = fetch_feed('<?php $key="delicious-feed"; echo get_post_meta($post->ID,$key,true); ?>') {
    global  $post
    if (!is_wp_error( $rss ) ) : }
    // Checks that the object is created correctly
        // Figure out how many total items there are, but limit it to 5.
        $maxitems = $rss->get_item_quantity(5);

    and get this error: “Parse error: syntax error, unexpected ‘{‘ in /home/hrcadmin/public_html/wp-content/themes/catch-box-child/member.php on line 126”

    Do I need to declare the global $post before I call the custom field?
    Sorry and thank you!

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