0

سلام من درحال طراحی یه پوسته هستم هم برا پروژه پایانیم هم برا فروش با یه تیر دوتا نشان زدن هست

من می خوام یه بلوک درست کنم تا مطالب یه دسته خاص رو نشون بده همه چی رو اوکی کردم فقط تو یه قسمت دچار مشکل شدم از شما راهنمایی می خوام
چیزی که درست کردم اینه:

وقتی روی ادامه فناوری کلیک می کنم تا فقط دسته فناوری رو نشون بده وقتی تو مطلب فقط دسته فناوری انتخاب شده باشه درست کار می کنه ولی مثلا در هنگام نوشتن مطلب اقتصادی,فناوری انتخاب می شه میره دسته اقتصادی
حالا من چطور می تونم این کار رو کنم که بره فناوری؟

نکته:دسته ها رو از طریق کنترل پنلی که براش ساختم معرفی می کنم

اینم از کد هام:(index)

<span class="tag"><div</span> <span class="atn">class</span><span class="pun">=</span><span class="atv">"box-category"</span><span class="tag">></span><span class="pln">
  </span><span class="pun"><?</span><span class="pln">php
$thcat </span><span class="pun">=</span><span class="pln"> get_option</span><span class="pun">(</span><span class="str">"shortname_3cat_2"</span><span class="pun">);</span> <span class="com">//////(از قسمت پنل انتخاب میشه شما فک کنید فناوری)</span><span class="pln">
$my_query </span><span class="pun">=</span> <span class="kwd">new</span><span class="pln"> WP_Query</span><span class="pun">(</span><span class="pln">array</span><span class="pun">(</span><span class="pln">
</span><span class="str">'post_status'</span> <span class="pun">=></span><span class="str">'publish'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'post_type'</span> <span class="pun">=></span><span class="str">'post'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'order'</span> <span class="pun">=></span><span class="str">'DESC'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'category_name'</span> <span class="pun">=></span><span class="pln"> $thcat</span><span class="pun">,</span><span class="pln">
</span><span class="str">'offset'</span> <span class="pun">=></span><span class="str">'0'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'no_found_rows'</span> <span class="pun">=></span> <span class="lit">1</span><span class="pun">,</span><span class="pln">
</span><span class="str">'posts_per_page'</span> <span class="pun">=></span> <span class="lit">1</span><span class="pun">,</span><span class="pln">
</span><span class="pun">));</span><span class="pln">
</span><span class="kwd">while</span> <span class="pun">(</span><span class="pln">$my_query</span><span class="pun">-></span><span class="pln">have_posts</span><span class="pun">()):</span><span class="pln">
$my_query</span><span class="pun">-></span><span class="pln">the_post</span><span class="pun">();</span><span class="pln">
$do_not_duplicate </span><span class="pun">=</span><span class="pln"> $post</span><span class="pun">-></span><span class="pln">ID</span><span class="pun">;</span><span class="pln">
$Cat_ID </span><span class="pun">=</span><span class="pln">the_category_ID</span><span class="pun">(</span><span class="pln">$echo</span><span class="pun">=</span><span class="kwd">false</span><span class="pun">);</span><span class="pln">$cat_title </span><span class="pun">=</span><span class="pln"> get_the_category_by_ID</span><span class="pun">(</span><span class="pln">$Cat_ID</span><span class="pun">)</span> <span class="pun">;?></span><span class="pln">
  </span><span class="tag"><div</span> <span class="atn">class</span><span class="pun">=</span><span class="atv">"title-category"</span><span class="tag">></span> <span class="pun"><?</span><span class="pln">php echo $thcat </span><span class="pun">;</span> <span class="pun">?></span> <span class="tag"></div></span><span class="pln">
  </span><span class="tag"><ul></span><span class="pln">
        </span><span class="tag"><li></span><span class="pln">
          </span><span class="pun"><?</span><span class="pln">php the_post_thumbnail</span><span class="pun">(</span><span class="str">'spContents'</span><span class="pun">);</span> <span class="pun">?></span><span class="pln">
          <a href="</span><span class="pun"><?</span><span class="pln">php the_permalink</span><span class="pun">();</span> <span class="pun">?></span><span class="pln">">
          </span><span class="tag"><div</span> <span class="atn">id</span><span class="pun">=</span><span class="atv">"post-hover"</span><span class="tag">></span><span class="pln">
                </span><span class="tag"><p></span><span class="pln">
                  </span><span class="pun"><?</span><span class="pln">php the_title</span><span class="pun">();</span> <span class="pun">?></span><span class="pln">
                </span><span class="tag"></p></span><span class="pln">
          </span><span class="tag"></div></span><span class="pln">
          </span><span class="tag"></a></span> <span class="tag"></li></span><span class="pln">
        </span><span class="pun"><?</span><span class="pln">php endwhile</span><span class="pun">;</span> <span class="pun">?></span><span class="pln">
        </span><span class="pun"><?</span><span class="pln">php
$thcat </span><span class="pun">=</span><span class="pln"> get_option</span><span class="pun">(</span><span class="str">"shortname_3cat_2"</span><span class="pun">);</span><span class="pln">
$my_query </span><span class="pun">=</span> <span class="kwd">new</span><span class="pln"> WP_Query</span><span class="pun">(</span><span class="pln">array</span><span class="pun">(</span><span class="pln">
</span><span class="str">'post_status'</span> <span class="pun">=></span><span class="str">'publish'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'post_type'</span> <span class="pun">=></span><span class="str">'post'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'order'</span> <span class="pun">=></span><span class="str">'DESC'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'category_name'</span> <span class="pun">=></span><span class="pln"> $thcat</span><span class="pun">,</span><span class="pln">
</span><span class="str">'offset'</span> <span class="pun">=></span><span class="str">'1'</span><span class="pun">,</span><span class="pln">
</span><span class="str">'no_found_rows'</span> <span class="pun">=></span> <span class="lit">1</span><span class="pun">,</span><span class="pln">
</span><span class="str">'posts_per_page'</span> <span class="pun">=></span> <span class="lit">4</span><span class="pun">,</span><span class="pln">
</span><span class="pun">));</span><span class="pln"> 
$Cat_ID </span><span class="pun">=</span><span class="pln"> the_category_ID</span><span class="pun">(</span><span class="pln">$echo</span><span class="pun">=</span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
$cat_title </span><span class="pun">=</span><span class="pln"> get_the_category_by_ID</span><span class="pun">(</span><span class="pln">$Cat_ID</span><span class="pun">);</span><span class="pln">
</span><span class="pun">?></span><span class="pln">
        </span><span class="pun"><?</span><span class="pln">php
</span><span class="kwd">while</span> <span class="pun">(</span><span class="pln">$my_query</span><span class="pun">-></span><span class="pln">have_posts</span><span class="pun">()):</span><span class="pln">
$my_query</span><span class="pun">-></span><span class="pln">the_post</span><span class="pun">();</span><span class="pln">
$do_not_duplicate </span><span class="pun">=</span><span class="pln"> $post</span><span class="pun">-></span><span class="pln">ID</span><span class="pun">;</span><span class="pln">
</span><span class="pun">?></span><span class="pln">
        </span><span class="tag"><li></span><span class="pln">
          </span><span class="pun"><?</span><span class="pln">php the_post_thumbnail</span><span class="pun">(</span><span class="str">'spContents'</span><span class="pun">);</span> <span class="pun">?></span><span class="pln">
          <a href="</span><span class="pun"><?</span><span class="pln">php the_permalink</span><span class="pun">();</span> <span class="pun">?></span><span class="pln">">
          </span><span class="tag"><p></span><span class="pln">
                </span><span class="pun"><?</span><span class="pln">php the_title</span><span class="pun">();</span> <span class="pun">?></span><span class="pln">
          </span><span class="tag"></p></span><span class="pln">
          </span><span class="tag"></a></span> <span class="tag"></li></span><span class="pln">
        </span><span class="pun"><?</span><span class="pln">php endwhile</span><span class="pun">;</span> <span class="pun">?></span><span class="pln">
        <a href="</span><span class="pun"><?</span><span class="pln">php  echo get_category_link</span><span class="pun">(</span><span class="pln"> $Cat_ID </span><span class="pun">);</span><span class="pln">  </span><span class="pun">?></span><span class="pln">" >
        </span><span class="tag"><li></span><span class="pln"> + ادامه </span><span class="pun"><?</span><span class="pln">php echo $thcat </span><span class="pun">;</span> <span class="pun">?></span><span class="tag"></li></span><span class="pln">
        </span><span class="tag"></a></span><span class="pln">
  </span><span class="tag"></ul></span><span class="pln">
</span><span class="tag"></div>
مهدی جان ممنون میشم پاسخ اینو بدید می دونم که سرت شلوغه ولی اگه میشه این رو اوکی کن
</span>