Search Results for 'posts loop'

Results from the Forum
garfieldx
tagDiv Member

Hi,

I would also like this feature. Totally makes sense.

I had the same issue in Block 4. I put the recommended code after the foreach loop in the inner() function.


....
foreach ($posts as $post) {
   if(!is_single($post->ID)) {

   ....

   }

BR, Claudio

simchris
tagDiv Member

<LOL> my one pet peeve since version 1x.

Right now you have to manually comment this out here in loop-single.php

            <div class="meta-info">
                <?php echo $td_mod_single->get_category();?>
                <?php echo //$td_mod_single->get_author();?>
                <?php echo $td_mod_single->get_date(false);?>
                <?php echo $td_mod_single->get_commentsAndViews();?>
            </div>

to
<?php echo $td_mod_single->get_author();?>

I keep trying to press the point that ALL newspapers show a byline for the journalist who writes an article — for the past 100+ years, and this should be *on* by default for the post page. It should be manually turned OFF for those running something other than a NEWSPAPER.

(HINT: RADU AND CO – please make this the NORM !!!! Author = ON for post page!)

Lucian
tagDiv Staff

Hi,

Add this code:

$adcounter = 0;

and

$adcounter++;
    if (is_category() or is_archive()) {
        if ($adcounter == 2 or $adcounter == 4 or $adcounter == 6) {
        echo do_shortcode('[td_ad_box spot_id="custom_ad_1"]');
        }
    }

in the loop.php file, like this: http://screencast.com/t/DsXKbb9C

This will add an ad after 2 post, 4 post and 6 posts on the category page and archive page also if you want you can change this simply by removing or by adding $adcounter == variable or changing it’s value as you want. Also notice that the code for these ad goes in the Ads > Custom Ad 1 > Your Custom Ad 1 in Theme Panel.

You will also need to add this custom CSS in Theme Panel > Custom CSS:

.category .td-a-rec-id-custom_ad_1{
margin-bottom: 30px !important;
}

.archive .td-a-rec-id-custom_ad_1{
margin-bottom: 30px !important;
}

You will get this result: http://screencast.com/t/nuHrZ7zhGY

Thanks

  • This reply was modified 12 years by Lucian.
Lucian
tagDiv Staff

Hi,

Please move this code inside the loop-single.php file like this: http://screencast.com/t/XmqLsGdg

Then inside td_modul_blog.php file, comment this code lines like this: http://screencast.com/t/3HREGPlV4xhc

Then move back to the loop.single.php file, and add this code http://pastebin.com/FhwPQJ7E like this: http://screencast.com/t/FpKwJuIu

Result: http://screencast.com/t/djok2unl

Thanks

  • This reply was modified 12 years by Lucian.
Lucian
tagDiv Staff

Hi,

1. Replace single.php file with this: http://pastebin.com/te1XynKV
2. Replace loop-single.php file with this: http://pastebin.com/11Z04FPy

3. Add this CSS:

.entry-crumbs {
position: relative;
top: 20px;
}

.span12 .td_grid_wrap {
padding-top: 25px;
}

.single-post .post {
padding-top: 35px;
padding-bottom: 0px;
}

.single-post .td-page-wrap .span12 .td-grid-wrap {
padding-top: 0px;
}
Lucian
tagDiv Staff

Hi,

Please disable the automaticaly display at the bottom of the post setting from nrelate plugin panel like this: http://screencast.com/t/bXpEDrWxFU
Then add this code:

<?php echo do_shortcode('[nrelate-related]'); ?>

..to your loop-single.php file like this: http://screencast.com/t/647C6yfu
Then you will be able to use your article bottom ad and it will be displayed above the nrelate plugin http://screencast.com/t/KjuW20OeFQ

Thank you

Lucian
tagDiv Staff

Hi,

You have to add this code http://pastebin.com/ecY7aQ50 to the single.php file like this: http://screencast.com/t/KVO2deGrh

Comment this section from loop-single.php file like this: http://screencast.com/t/8PMBsVFH
And add this custom CSS in Theme Panel -> Custom CSS:

.post header {
top: 0px !important;
}

Thank you

  • This reply was modified 12 years by Lucian.
  • This reply was modified 12 years by Lucian.
rbaccaro
tagDiv Member

Hi Lucian, thank you.

I did it for the loop-single.php and worked like this:

if ( 1 !== get_the_author_meta( ‘ID’ ) ) {
echo $td_mod_single->get_author_box();
}

Where should I add the same conditional to stop listing everywhere in the site like on archives.php, search.php etc?

Lucian
tagDiv Staff

Hi,

Add this code to the loop-single.php file like this: http://screencast.com/t/ELXmZQpHSQ

<?php
$author_cx = get_the_author();
if ($author_cx != 'admin'){
echo $td_mod_single->get_author_box();
}
?>

Thank you

  • This reply was modified 12 years by Lucian.
  • This reply was modified 12 years by Lucian.
Emil G
tagDiv Staff

Hi,

You can still show the tags on posts, just add this code into the loop-single.php file:
http://screencast.com/t/1UXn8sTfE

<?php
            $closing_c_tags = 'td-tags-and-social-wrapper-box-bottom-line';
            $t_post_tags = $td_mod_single->get_the_tags();
            if(!empty($t_post_tags)) {
                $post_tags_wr = '<div class="td-tags-and-social-wrapper-box ' . $closing_c_tags . '"> ' . $t_post_tags . '</div>';
            }
            echo $post_tags_wr;
            ?>

Thank you, Emil G.

tweider
Participant
#0

Hi Guys,
We use “Newspaper” theme with plugin “The Events Calendar”.
Plugin create custom post type events.
We created the page template that get all posts from custom post type and display them as category page (loop, work ok).
wp_query loop below

$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
 $event_query = new WP_Query(array(
    'post_type' => 'tribe_events',
    'posts_per_page' => get_option('posts_per_page'),
    'paged' => $paged,
    'orderby' => 'meta_value_num',
    'meta_key' => '_EventStartDate'
 ));

Below loop we add pagination like
echo td_page_generator::get_pagination();
and it’s not displayed on page

Can you help with it pls?
Did your pagination allow to use custom post type?
Does the problem in pagination function or something other?

Thank for your help

Bryson T
tagDiv Member

Why would I have to make edits for the default thumbnails included in the theme to fit their display areas as defined by the theme????????

http://screencast.com/t/7IyXAcTIWZiM

Notice the directory structure is the core Newspaper directory upon download, not upload – WordPress has nothing to do with this issue. I’m not messing with the thumbnails WordPress generates. I’m using the Newspaper default images and they do not fit the slide. My custom default images are named exactly the same and with the same .png format and precise dimensions as these pictured. This isn’t a custom code issue.

And I don’t upload a featured image in every post for two reasons:
1. I don’t want a featured image on loop-single.php for every post. Good thing for me the theme comes with built-in default image support for posts without a featured image.

2. There are a lot of old posts that don’t have a featured image. These posts also have no images within the posts.

All I need to know is what the minimum dimensions of that slide image need to be to fit the slide.

There should be absolutely NO CROPPING of that default image. Images made at 745×483 (Matches included theme files) or 743×481 (Matches themes default slide resize) gets sucked down to 700×454 (Too small to fill the space).

That area is 743×481 (Actual pixel dimensions of the slide, no borders or padding applies) so the image must show as 743×481 to fill the area allowed for it.

Thanks

Bryson T
tagDiv Member

What you’re wanting is loop-single.php with a loop of posts afterward like homepage with loop. I’ve found no shortcode to accomplish this. You’d need to make a new post template from the homepage with loop page template (easiest way) but that’s not a feature in Newspaper. My advice is to hire a programmer for this task as it’s quite complicated requiring js, php, html, and css knowledge to make it work.

Marius
tagDiv Staff

Hi,
If you go to the next page you will see that the loop works correctly, showing you 5 posts per page, and on you first page you have more because you have sticky posts. Please remove the sticky posts.

Thanks for the message!

costahilbert
tagDiv Member

Hi Radu,

I have disabled all plugins through ftp by renaming the plugins folder.

The Homepage Loops Filter Posts per page is set to 5

The Setting > Reading – “Blog pages show at most” is also set to 5

As you can see at http://betheline.com/dev/ there are more than 5 posts showing.

Any help is greatly appreciated

costahilbert
Participant
#0

Hi,

I am trying to limit the number of posts on my homepage.

I adjust the number of Posts per page in the homepage loop filter but it doesn’t change.

Any help would be greatly appreciated.

thanks

Marius
tagDiv Staff

Hi,
The theme come with Featured category and to mark a post as featured just include a post in that category FEATURED

Sticky post just move the post in top in loops, don’t use sticky. Use Featured category.

Thanks for the message!

r1kay
tagDiv Member

Well i use the sharedcount api to count the total shares for me. It´s considered one of the fastest api to do this. Maybe i have configured the function wrong, i´ve tested it without caching and this peace of code make the website render at least 3 seconds later. Maybe you can have a look:

function getTotalShares($atts) {
extract(shortcode_atts(array(
    'cache' => '600',
    'url' => 0,
    'f' => 0,
    'bgcolor' => '#7bc6f1',
    'bordercolor' => '#000',
    'borderwidth' => '0',
    'bordertype' => 'solid',
    'fontcolor' => '#fff',
    'fontsize' => '18',
    'fontweight' => 'normal',
    'padding' => '1',
	'fontfamily' => 'Oswald'
  ), $atts));

 $shareHash = "$cache.$url.$f.$bgcolor.$bordercolor.$borderwidth.$bordertype.$fontcolor.$fontsize.$fontweight.$padding.$fontfamily";
 $totalShareRecord = 'totalshares_' . $shareHash;
 $cachedposts = get_transient($totalShareRecord);
 if ($cachedposts !== false) {
 return $cachedposts;

 } else {

   if (!$url) $url = get_permalink($post->ID);

   $json = wp_remote_retrieve_body( wp_remote_get("http://api.sharedcount.com/?url=" . rawurlencode($url) . "&apikey=0928d3131a18a15945e4c74fa1a68cef3c6f2ad8"));
    $counts = json_decode($json, true);
    $return = $counts['Twitter'] + $counts['Facebook']['total_count'] + $counts['GooglePlusOne'];
    if ($f) $return = '<div id="totalshares"><img src="http://mhmag.nl/content/uploads/2014/04/viral-icon-retina-42-x-42.png" width="21" height="21" /><div id="sharecounter">' . $return . '</div><div id="gedeeld">x gedeeld</div></div>';
    set_transient($totalShareRecord, $return, $cache);
    return $return;
 }
}
add_shortcode('totalshares','getTotalShares');

Also, the total share counts are shown right below the post title, so maybe that prevents the page from rendering? I’ve added the shortcode in loop-sigle.php right below the page title and above the category and date meta.

Without this function the website will load very quickley, even without cache, due to the nginx set up.

  • This reply was modified 12 years by r1kay.
cybergetro
tagDiv Member

Hi, Radu.

I don’t have needs to remove the post from the loop. I just need to prevent Google Ads appears in the post.

Do you have any clue?

Thanks,
CyberGetro

Radu A
tagDiv Member

hi,
you need to take the id of the post outside of the loop, then in the areas where the ads are showed you need to test to see if the post id is the adult one. if yes then don’t shoe the ad. use if else for this.

the theme was not created like this, and is not easy to do this.

hope this help.

Thanks for you message.
Radu A.

Marius
tagDiv Staff

Hi,
The default template is used only if you want to achieve a default WordPress page (content + sidebar) the other templates are built by use to make custom pages with sidebar or without, with post loop + pagination, as you can see in the documentation of the templates https://forum.tagdiv.com/page-templates/

You have used before the Visual composer(page builder) You can use it to build the page layout and to add content blocks.

Also from the template you can change some settings to: http://screencast.com/t/YDN6lyfLkD From here you have Posts per page settings for that page.

Can you give me your site URL and tell me what you can’t achieve

Thanks!

Marius
tagDiv Staff

Hi,
Sorry but i can’t find a working solution. Also please do not use the above solution, i see that brake the block functionality when you use sorting category.

The sticky post works fine in loop but not in blocks.

Marius
tagDiv Staff

Hi,
Add this code:
global $loop_sidebar_position;

if($loop_sidebar_position == 'no_sidebar') {
   return;
}

like here: http://screencast.com/t/sUhlOTrHWk

Thanks!

Marius
tagDiv Staff

Hi,
At this moment is only a template and don’t have parameters to filter the posts there.

The file where the timeline template are coded is loop-timeline.php you can add there some condition manualy like if you are on a particular page use this filter

if (is_page(2)) {
    query_posts($query_string . '&cat=1,2,3');
}

like here: http://screencast.com/t/SCoFpLdxV

Make some conditions for each timeline page.

To add a thumbnails add this code: the_post_thumbnail('thumbnail'); like here: http://screencast.com/t/SblP5k4aP6K

then add this CSS in Theme panel -> Custom CSS

.timeline .wp-post-image {
    padding-right: 10px;
    width: 40px;
}

Thanks for the message!

simchris
Participant
#0

Hello all..
if you’re getting some bizarre things on your site from using YOAST SEO 1.5x, after upgrading from the stable 1.4.25 version, please be aware of the following major issues.

I am recommending you NOT upgrade to Yoast SEO 1.5x until they get a stable version!

——–
There have been a LARGE number of bugs with the Yoast SEO plugin released last week (1.5), and about three or four patches so far. Still buggy as hell with 1.5.2.3 (including option for Google News keywords not saving to dbase or showing in the SEO post panel). I rolled back my sites to the prior version (stable), 1.4.25 due to a lot of issues including a major memory spike on our server post 1.5 update. If you look at the changelog for 1.5 it’s pretty awful, and doesn’t bode well for their new development team, frankly.

-Chris

SERIOUSLY …. (!)

— YOAST SEO 1.5 BUG FIXES (SO FAR) —

1.5.2.3

** Note: if you already upgraded to v1.5+, you will need to retrieve your Facebook Apps again and please also check your Google+ URL. We had some bugs with both being escaped too aggressively. Sorry about that. **

◾Bugfixes
◾Added missing settings menu pages to wp admin bar.
◾Replaced old AdWords keyword tool link.
◾Fix wp admin bar keyword density check link
◾Taxonomy sitemap will now also show if empty.
◾Prevent infinite loop triggered by sitemap_close(), fixes #600 as reported and fixed by pbogdan.
◾Fixed a link count Page Analysis bug.
◾Fixed a keyword density problem in the Page Analysis
◾Fixed OpenGraph/GooglePlus/Twitter tags not showing in a select few themes, issue #750 as reported by Jovian and wwdboer – props Jrf.
◾Fixed Facebook Apps not being saved/ “Failed to retrieve your apps from Facebook” as reported by kevinlisota in issue #812 – props Jrf.
◾Fixed duplicate feedback messages on WPSEO -> Social pages as reported by steverep in issue #743 – props Jrf.
◾Flush our force title rewrite buffer earlier in wp_footer so it can be used by other plugins in wp_footer. Props Gabriel Pérez Salazar.
◾Start the force rewrite buffer late (at 999) in template_redirect instead of get_header because of several themes not using get_header, issue #817 as reported by Jrf.
◾Fixed ‘Page %d of %d’ / %%page%% variable not being replaced when on pages, as reported by SGr33n in issue #801 – props Jrf.
◾Restore robots meta box per post to its former glory, it now shows even when blog is not set to public.
◾Fixed individual page robots settings not being respected when using a page as blog as reported by wintersolutions in issue #813 – props Jrf.
◾Fixed: Too aggressive html escaping of the breadcrumbs.
◾Fixed: Last breadcrumb wasn’t always determined correctly resulting in crumbs not being linked when they should have been.
◾Fixed: Breadcrumbs were sometimes missing separators and default texts since v1.5.0.
◾Fixed: 404 date based breadcrumb and title creation could cause corruption of the $post object.
◾Fixed: Filtering posts based on SEO score via the dropdown at the top of a post/page overview page no longer worked. Fixed. As reported by gmuehl in issue #838 – props Jrf.

◾Enhancements
◾Added filters for the change frequencies of different URLs added to the sitemap. Props to haroldkyle for the idea.
◾Added filter wpseo_sitemap_exclude_empty_terms to allow including empty terms in the XML sitemap.
◾Private posts now default to noindex (even though they technically probably couldn’t be indexed anyway).
◾Show a warning message underneath a post’s robots meta settings when site is set to noindex sitewide in WP core.
◾Updated licensing class to show a notice when requests to yoast.com are blocked because of WP_HTTP_BLOCK_EXTERNALS.

◾Other
◾Refactored the breadcrumb class – props Jrf.

1.5.2.2

◾Bugfixes
◾Fix for issue with Soliloquy image slider was not applied to minified js file.
◾Fixed some PHP ‘undefined index’ notices.
◾Fix banner images overlapping text in help tabs.
◾Fixed meta description tag not showing for taxonomy (category/tag/etc) pages as reported in issue #737 and #780 – props Jrf.
◾Prevent a fatal error if wp_remote_get() fails while testing whether the title needs to be force rewritten as reported by homeispv – props Jrf.

◾Enhancements
◾Added composer support – props codekipple and Rarst.

1.5.2.1

◾Bugfixes
◾Fix white screen/blog down issues caused by some (bloody stupid) webhosts actively disabling the filter extension – props Jrf.
◾Fix for some PHP notices, issue #747 as reported by benfreke – props Jrf.
◾Fixed: GooglePlus vanity urls were saved without the + as reported by ronimarin in issue #730 – props Jrf.
◾Fix WP Admin menu items no longer clickable when on WPSEO pages as reported in issue #733 and #738 – props Jrf.
◾Fix strict warning for W3TC, issue 721.
◾Fix RSS text strings on options page being double escaped, issue #731 as reported by namaserajesh – props Jrf.
◾Avoid potential confusion over Facebook OpenGraph front page usage, issue #570 – props Jrf.
◾Potentially fix issue 565 bbpress warning message. Thanks inetbiz for reporting and tobylewis for finding the likely cause.
◾Filter ‘wpseo_pre_analysis_post_content’ output is now only loaded in DOM object if not empty. – props mgmartel.
◾$post_content is now unset after loading in DOM object. – props mgmartel.
◾Fix Alexa ID string validation, as reported by kyasajin and Bubichka in issue 736 – props Jrf.
◾Fix issue with Soliloquy image query, as reported by osalcedo and mattisherwood in issue #733 – props Jrf.

◾Enhancements
◾Twitter metatag key is now filterable by ‘wpseo_twitter_metatag_key’.
◾Added a filter called “wpseo_replacements” in wpseo_replace_vars to allow customization of the replacements before they are applied – props martinernst.
◾Added useful links for page analysis – props bhubbard.

◾i18n Updates
◾Updated nl_NL, id_ID, it_IT, fr_FR and de_DE
◾Added ko
◾Updated .pot file.

1.5.2
◾Bugfix: ◾If mbstring extension isn’t loaded, fatal error was thrown.

Viewing 25 results - 1,701 through 1,725 (of 1,749 total)