So you should work to enable the below function:
Point number 1 is very important to implement because without it no benefit to having the course list widget.
Is there a way to make image active link when using querry block? Title, Excerpt works fine, but I have not found a way to activate link for the image.
Note: in this case I am using the cover block to present image.
thx.
]]>function getSomePost($category,$postsPerPage=3) {
global $post;
$args = array(
'category_name'=>$category,
'posts_per_page'=>$postsPerPage,
'post_type'=>'post',
'post_status'=>'publish',
'post__not_in'=>array($post->ID),
'orderby'=>'rand',
);
switch ($category)
{
case 'news':
$args['interval'] = '1 MONTH';
break;
case 'analysis':
$args['interval'] = '3 MONTH';
break;
case 'reports':
$args['interval'] = '3 MONTH';
break;
}
$query = new WP_Query($args);
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$postThumbClass = 'no-thumb';
?>
<div <?php post_class(array('wp-post-entry', 'sidebar-post' )); ?>>
<?php if(has_post_thumbnail ()):?>
<?php $postThumbClass = '' ?>
<div class="wp-post-thumbnail">
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail(array(70,70)); ?>
</a>
</div>
<?php endif; ?>
<div class="wp-post-full-content <?php echo $postThumbClass ?> ">
<h3 class="wp-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<!--
<div class="post-content">
<?php the_excerpt() ?>
</div>
//-->
</div>
</div>
I was trying to replace inside switch
case 'news':
$args['interval'] = '1 MONTH';
break;
with
case 'news':
// Create a new filtering function that will add our where clause to the query
function filter_where( $where = '' ) {
// posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
add_filter( 'posts_where', 'filter_where' );
$query = new WP_Query( $args );
remove_filter( 'posts_where', 'filter_where' );
break;
and
case 'analysis':
$args['interval'] = '3 MONTH';
break;
with
case 'analysis':
// Create a new filtering function that will add our where clause to the query
function filter_where( $where = '' ) {
// posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-90 days')) . "'";
return $where;
}
add_filter( 'posts_where', 'filter_where' );
$query = new WP_Query( $args );
remove_filter( 'posts_where', 'filter_where' );
break;
but it is not working I tried also to use if ($category == 'news')
but it breaks the site
I would like to display a category of post on a page, with the first post listed completely, with the next 4 posts listed in an unordered list, and then have the pagination still work.
All I have found for this were written before WP 3.X so I think the answer has changed. Any help on this or a link to the answer would be appreciated. This will be for https://rrea.com but don’t have anything to show you yet.
Thanks in advance.
]]>Each company can exists as distinct posts (same title, but different content) in multiple categories (so I can have a post called Microsoft in software section and again another post called also Microsoft (same title, but different content) in hardware section.
I want to display a list with all companies (but no double entries). So only one Microsoft in my example.
My below code – still display duplicates
<?php
if ($companies = $wpdb->get_results("SELECT DISTINCT wposts.*
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
WHERE wposts.ID = wpostmeta.post_id
AND wpostmeta.meta_key = 'field-company-type'
AND wpostmeta.meta_value = 'j'
AND wposts.post_status = 'publish'
AND wposts.post_type = 'post'
AND wposts.post_date < NOW()
ORDER BY wposts.post_title DESC")):
?>
<ul>
<?php
foreach ($companies as $post) {
if ($post->post_title == '') $post->post_title = sprintf(__('Post #%s'), $post->ID);
echo "<li><a href='".get_permalink($post->ID)."'>";
the_title();
echo '</a></li>';
}
?>
</ul>
<?php endif; ?>
Can anybody help me with this?
]]>This is the email they had sent me:
Site is running the following query against the database server which is degrading performance for all other customers:
rambleent_IC_20100619_052734^@UPDATE wp_sitemeta
SET meta_value
=
‘a:2:{s:8:\”versions\”;a:2:{s:7:\”version\”;s:5:\”2.0.2\”;s:10:\”db_version\”;s:3:\”2.0\”;}s:4:\”data\”;a:3:{s:17:\”post_types_loaded\”;a:36688:{i:0;b:1;i:1;b:1;i:2;b:1;i:3;b:1;i:4;b:1;i:5;b:1;i:6;b:1;i:7;b:1;i:8;b:1;i:9;b:1;i:10;b:1;i:11;b:1;i:12;b:1;i:13;b:1;i:14;b:1;i:15;b:1;i:16;b:1;i:17;b:1;i:18;b:1;i:19;b:1;i:20;b:1;i:21;b:1;i:22;b:1;i:23;b:1;i:24;b:1;i:25;b:1;i:26;b:1;i:27;b:1;i:28;b:1;i:29;b:1;i:30;b:1;i:31;b:1;i:32;b:1;i:33;b:1;i:34;b:1;i:35;b:1;i:36;b:1;i:37;b:1;i:38;b:1;i:39;b:1;i:40;b:1;i:41;b:1;i:42;b:1;i:43;b:1;i:44;b:1;i:45;b:1;i:46;b:1;i:47;b:1;i:48;b:1;i:49;b:1;i:50;b:1;i:51;b:1;i:52;b:1;i:53;b:1;i:54;b:1;i:55;b:1;i:56;b:1;i:57;b:1;i:58;b:1;i:59;b:1;i:60;b:1;i:61;b:1;i:62;b:1;i:63;b:1;i:64;b:1;i:65;b:1;i:66;b:1;i:67;b:1;i:68;b:1;i:69;b:1;i:70;b:1;i:71;b:1;i:72;b:1;i:73;b:1;i:74;b:1;i:75;b:1;i:76;b:1;i:77;b:1;i:78;b:1;i:79;b:1;i:80;b:1;i:81;b:1;i:82;b:1;i:83;b:1;i:84;b:1;i:85;b:1;i:86;b:1;i:87;b:1;i:88;b:1;i:89;b:1;i:90;b:1;i:91;b:1;i:92;b:1;i:93;b:1;i:94;b:1;i:95;b:
1;i:96;b:1;i:97;b:1;i:98;b:1;i:99;b:1;i:100;b:1;i:101;b:1;i:102;b:1;i:103;b:1;i:104;b:1;i:105;b:1;i:106;b:1;i:107;b:1;i:108;b:1;i:109;b:1;i:110;b:1;i:111;b:1;i:112;b:1;i:113;b:1;i:114;b:1;i:115;b:1;i:116;b:1;i:117;b:1;i:118;b:1;i:119;b:1;i:120;b:1;i:121;b:1;i:122;b:1;i:123;b:1;i:124;b:1;i:125;b:1;i:126;b:1;i:127;b:1;i:128;b:1;i:129;b:1;i:130;b:1;i:131;b:1;i:132;b:1;i:133;b:1;i:134;b:1;i:135;b:1;i:136;b:1;i:137;b:1;i:138;b:1;i:139;b:1;i:140;b:1;i:141;b:1;i:142;b:1;i:143;b:1;i:144;b:1;i:145;b:1;i:146;b:1;i:147;b:1;i:148;b:1;i:149;b:1;i:150;b:1;i:151;b:1;i:152;b:1;i:153;b:1;i:154;b:1;i:155;b:1;i:156;b:1;i:157;b:1;i:158;b:1;i:159;b:1;i:160;b:1;i:161;b:1;i:162;b:1;i:163;b:1;i:164;b:1;i:165;b:1;i:166;b:1;i:167;b:1;i:168;b:1;i:169;b:1;i:170;b:1;i:171;b:1;i:172;b:1;i:173;b:1;i:174;b:1;i:175;b:1;i:176;b:1;i:177;b:1;i:178;b:1;i:179;b:1;i:180;b:1;i:181;b:1;i:182;b:1;i:183;b:1;i:184;b:1;i:185;b:1;i:186;b:1;i:187;b:1;i:188;b:1;i:189;b:1;i:190;b:1;i:191;b:1;i:192;b:1;i:193;b:1;i:194;b:1;i:195;b:1;
i:196;b:1;i:197;b:1;i:198;b:1;i:199;b:1;i:200;b:1;i:201;b:1;i:202;b:1;i:203;b:1;i:204;b:1;i:205;b:1;i:206;b:1;i:207;b:1;i:208;b:1;i:209;b:1;i:210;b:1;i:211;b:1;i:212;b:1;i:213;b:1;i:214;b:1;i:215;b:1;i:216;b:1;i:217;b:1;i:218;b:1;i:219;b:1;i:220;b:1;i:221;b:1;i:222;b:1;i:223;b:1;i:224;b:1;i:225;b:1;i:226;b:1;i:227;b:1;i:228;b:1;i:229;b:1;i:230;b:1;i:231;b:1;i:232;b:1;i:233;b:1;i:234;b:1;i:235;b:1;i:236;b:1;i:237;b:1;i:238;b:1;i:239;b:1;i:240;b:1;i:241;b:1;i:242;b:1;i:243;b:1;i:244;b:1;i:245;b:1;i:246;b:1;i:247;b:1;i:248;b:1;i:249;b:1;i:250;b:1;i:251;b:1;i:252;b:1;i:253;b:1;i:254;b:1;i:255;b:1;i:256;b:1;i:257;b:1;i:258;b:1;i:259;b:1;i:260;b:1;i:261;b:1;i:262;b:1;i:263;b:1;i:264;b:1;i:265;b:1;i:266;b:1;i:267;b:1;i:268;b:1;i:269;b:1;i:270;b:1;i:271;b:1;i:272;b:1;i:273;b:1;i:274;b:1;i:275;b:1;i:276;b:1;i:277;b:1;i:278;b:1;i:279;b:1;i:280;b:1;i:281;b:1;i:282;b:1;i:283;b:1;i:284;b:1;i:285;b:1;i:286;b:1;i:287;b:1;i:288;b:1;i:289;b:1;i:290;b:1;i:291;b:1;i:292;b:1;i:293;b:1;i:294;b:1;i:295;b:
1;i:296;b:1;i:297;b:1;i:298;b:1;i:299;b:1;i:300;b:1;i:301;b:1;i:302;b:1;i:303;b:1;i:304;b:1;i:305;b:1;i:306;b:1;i:307;b:1;i:308;b:1;i:309;b:1;i:310;b:1;i:311;b:1;i:312;b:1;i:313;b:1;i:314;b:1;i:315;b:1;i:316;b:1;i:317;b:1;i:318;b:1;i:319;b:1;i:320;b:1;i:321;b:1;i:322;b:1;i:323;b:1;324;b:1;i:325;b:1;i:326;b:1;i:327;b:1;i:328;b:1;i:329;b:1;i:330;b:1;i:331;b:1;i:332;b:1;i:333;b:1;i:334;b:1;i:335;b:1;i:336;b:1;i:337;b:1;i:338;b:1;i:339;b:1;i:340;b:1;i:341;b:1;i:342;b:1;i:343;b:1;i:344;b:1;i:345;b:1;i:346;b:1;i:347;b:1;i:348;b:1;i:349;b:1;i:350;b:1;i:351;b:1;i:352;b:1;i:353;b:1;i:354;b:1;i:355;b:1;i:356;b:1;i:357;b:1;i:358;b:1;i:359;b:1;i:360;b:1;i:361;b:1;i:362;b:1;i:363;b:1;i:364;b:1;i:365;b:1;i:366;b:1;i:367;b:1;i:368;b:1;i:369;b:1;i:370;b:1;i:371;b:1;i:372;b:1;i:373;b:1;i:374;b:1;i:375;b:1;i:376;b:1;i:377;b:1;i:378;b:1;i:379;b:1;i:380;b:1;i:381;b:1;i:382;b:1;i:383;b:1;i:384;b:1;i:385;b:1;i:386;b:1;i:387;b:1;i:388;b:1;i:389;b:1;i:390;b:1;i:391;b:1;i:392;b:1;i:393;b:1;i:394;b:1;i:395;b:
1;i:396;b:1;i:397;b:1;i:398;b:1;i:399;b:1;i:400;b:1;i:401;b:1;i:402;b:1;i:403;b:1;i:404;b:1;i:405;b:1;i:406;b:1;i:407;b:1;i:408;b:1;i:409;b:1;i:410;b:1;i:411;b:1;i:412;b:1;i:413;b:1;i:414;b:1;i:415;b:1;i:416;b:1;i:417;b:1;i:418;b:1;i:419;b:1;i:420;b:1;i:421;b:1;i:422;b:1;i:423;b:1;i:424;b:1;i:425;b:1;i:426;b:1;i:427;b:1;i:428;b:1;i:429;b:1;i:430;b:1;i:431;b:1;i:432;b:1;i:433;b:1;i:434;b:1;i:435;b:1;i:436;b:1;i:437;b:1;i:438;b:1;i:439;b:1;i:440;b:1;i:441;b:1;i:442;b:1;i:443;b:1;i:444;b:1;i:445;b:1;i:446;b:1;i:447;b:1;i:448;b:1;i:449;b:1;i:450;b:1;i:451;b:1;i:452;b:1;i:453;b:1;i:454;b:1;i:455;b:1;i:456;b:1;i:457;b:1;i:458;b:1;i:459;b:1;i:460;b:1;i:461;b:1;i:462;b:1;i:463;b:1;i:464;b:1;i:465;b:1;i:466;b:1;i:467;b:1;i:468;b:1;i:469;b:1;i:470;b:1;i:471;b:1;i:472;b:1;i:473;b:1;i:474;b:1;i:475;b:1;i:476;b:1;i:477;b:1;i:478;b:1;i:479;b:1;i:480;b:1;i:481;b:1;i:482;b:1;i:483;b:1;i:484;b:1;i:485;b:1;i:486;b:1;i:487;b:1;i:488;b:1;i:489;b:1;i:490;b:1;i:491;b:1;i:492;b:1;i:493;b:1;i:494;b:1;i:495;
b:1;i:496;b:1;i:497;b:1;i:498;b:1;i:499;b:1;i:500;b:1;i:501;b:1;i:502;b:1;i:503;b:1;i:504;b:1;i:505;b:1;i:506;b:1;i:507;b:1;i:508;b:1;i:509;b:1;i:510;b:1;i:511;b:1;i:512;b:1;i:513;b:1;i:514;b:1;i:515;b:1;i:516;b:1;i:517;b:1;i:518;b:1;i:519;b:1;i:520;b:1;i:521;b:1;i:522;b:1;i:523;b:1;i:524;b:1;i:525;b:1;i:526;b:1;i:527;b:1;i:528;b:1;i:529;b:1;i:530;b:1;i:531;b:1;i:532;b:1;i:533;b:1;i:534;b:1;i:535;b:1;i:536;b:1;i:537;b:1;i:538;b:1;i:539;b:1;i:540;b:1;i:541;b:1;i:542;b:1;i:543;b:1;i:544;b:1;i:545;b:1;i:546;b:1;i:547;b:1;i:548;b:1;i:549;b:1;i:550;b:1;i:551;b:1;i:552;b:1;i:553;b:1;i:554;b:1;i:555;b:1;i:556;b:1;i:557;b:1;i:558;b:1;i:559;b:1;i:560;b:1;i:561;b:1;i:562;b:1;i:563;b:1;i:564;b:1;i:565;b:1;i:566;b:1;i:567;b:1;i:568;b:1;i:569;b:1;i:570;b:1;i:571;b:1;i:572;b:1;i:573;b:1;i:574;b:1;i:575;b:1;i:576;b:1;i:577;b:1;i:578;b:1;i:579;b:1;i:580;b:1;i:581;b:1;i:582;b:1;i:583;b:1;i:584;b:1;i:585;b:1;i:586;b:1;i:587;b:1;i:588;b:1;i:589;b:1;i:590;b:1;i:591;b:1;i:592;b:1;i:593;b:1;i:594;b:1;i:
595;b:1;i:596;b:1;i:597;b:1;i:598;b:1;i:599;b:1;i:600;b:1;i:601;b:1;i:602;b:1;i:603;b:1;i:604;b:1;i:605;b:1;i:606;b:1;i:607;b:1;i:608;b:1;i:609;b:1;i:610;b:1;i:611;b:1;i:612;b:1;i:613;b:1;i:614;b:1;i:615;b:1;i:616;b:1;i:617;b:1;i:618;b:1;i:619;b:1;i:620;b:1;i:621;b:1;i:622;b:1;i:623;b:1;i:624;b:1;i:625;b:1;i:626;b:1;i:627;b:1;i:628;b:1;i:629;b:1;i:630;b:1;i:631;b:1;i:632;b:1;i:633;b:1;i:634;b:1;i:635;b:1;i:636;b:1;i:637;b:1;i:638;b:1;i:639;b:1;i:640;b:1;i:641;b:1;i:642;b:1;i:643;b:1;i:644;b:1;i:645;b:1;i:646;b:1;i:647;b:1;i:648;b:1;i:649;b:1;i:650;b:1;i:651;b:1;i:652;b:1;i:653;b:1;i:654;b:1;i:655;b:1;i:656;b:1;i:657;b:1;i:658;b:1;i:659;b:1;i:660;b:1;i:661;b:1;i:662;b:1;i:663;b:1;i:664;b:1;i:665;b:1;i:666;b:1;i:667;b:1;i:668;b:1;i:669;b:1;i:670;b:1;i:671;b:1;i:672;b:1;i:673;b:1;i:674;b:1;i:675;b:1;i:676;b:1;i:677;b:1;i:678;b:1;i:679;b:1;i:680;b:1;i:681;b:1;i:682;b:1;i:683;b:1;i:684;b:1;i:685;b:1;i:686;b:1;i:687;b:1;i:688;b:1;i:689;b:1;i:690;b:1;i:691;b:1;i:692;b:1;i:693;b:1;i:694;b:1;
i:695;b:1;i:696;b:1;i:697;b:1;i:698;b:1;i:699;b:1;i:700;b:1;i:701;
In order to be unsuspended, the query must be removed, must stop entirely, or customer should move to a dedicated/virtual server in which we can recommend a partner company to work with.
I would really really appreciate any help I can get regarding this, what this script is and how to remove it as I really need to get my sites up and running asap! Thanks in advance! -Alex
]]>I am using the ‘Random Image Theme’ although I have tested this issue using a new, clean theme and the problem still exists.
Each page (including index) involke <?php get_sidebar(); ?> and sidebar.php calls for the searchform.php so it appears that all pages use the same code
I wonder if there is some kind or “realative” or “absolute” refference that prevents searchform.php from accessing the the database.
https://ward4guelph.ca
]]>