Register Now


By registering, you agree to the Terms of Service and Privacy Policy.

Login

Forget


Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Add question

Please type your username .

Please type your E-Mail .

Please choose an appropriate title for the question to answer it even easier .

Please choose the appropriate category so others can easily search your question.

Please choose suitable Keywords Ex : question , poll .

This question is a poll ? If you want to be doing a poll click here .

Browse

Anonymous asks

Do you need a video to description the problem better ?

Choose from here the video type .

Put here the video id : https://www.youtube.com/watch?v=sdUUx5FdySs EX : 'sdUUx5FdySs'.

Notified by e-mail at incoming answers.

By asking your question, you agree to the Terms of Service and Privacy Policy.


x

Login

Forget


Register Now

Thank you for registering with WPTricks

Create an account
x
  • Login
  • Add Post
  • Badges
  • Contact Us
Ask a Question
  • Home
  • Ask Question
  • Themes
  • Plugins
  • Tutorials
  • Books

Login

Forget


Register Now

Thank you for registering with WPTricks

Create an account
  • Login
  • Add Post
  • Badges
  • Contact Us

wptricks

  • Home
  • Ask Question
  • Themes
  • Plugins
  • Tutorials
  • Books

conditional-tags

Home/ conditional-tags

How should I be using filters and is_single together?

Question
I have a plugin that uses this filter to add some content to a Custom Post Type. // From plugin: add_filter( 'the_content', 'sixtenpresssermons_get_meta', 15 ); I'd like to remove that filter on certain views (singles). I'd like to do so using code in my the
0
conditional-tags, filters Anders Carlen 3 years 0 Answers 40 views

issue with if/elseif in_array inside foreach loop display only one post

Question
I try to attribute a specific background-color to each post if one of categories of post corresponding to one category. My function works but is restricted to display only one post in result. If I delete this function, all post are displayed. More informations : On my page I have buttons t
0
array, categories, conditional-tags, functions, loop imagIne 3 years 0 Answers 47 views

How to check if a block has alignfull using a conditional?

Question
Are there any conditional queries to check if a block has an alignfull class for example? I'm using the below which when part of another function adds the color overlay class to my body classes, but ideally this should only happen if the block is set to alignfull. if ( 'core
in progress 0
block-editor, conditional-tags Jamie Mitchell 3 years 1 Answer 53 views

Limit posts only on home page – ideally in functions.php

Question
I'd like to restrict the number of posts that show on my home page to 3, but have all the other archive, category, pagination pages, etc. at whatever number I set in the "reading" settings in the Wordpress dashboard. Is there a nice way to do this in functions.php? I tried the follo
0
conditional-tags, functions, homepage Lori L 3 years 0 Answers 47 views

Conditional tag to check if ‘page.php’ is being used?

Question
I'm trying to check whether the page.php template is being used or not. I've tried is_page_template( 'page.php' ) but it doesn't work. I also can't use is_page() because I only want to do something when page.php is used, and not when some other cust
0
conditional-tags, page-template, pages user1981248 3 years 0 Answers 47 views

WooCommerce Default Sorting Before Hooks

Question
Seems there is no action to load something before the default sorting or ordering in WooCommerce. So I tried to use the WooCommerce before loop to see if that would work as a location to load the WMPL Currency Converter. if (is_tax( 'product_ca
0
conditional-tags, hooks rhand 3 years 0 Answers 52 views

A simple method for disabling WPML language switcher when meeting specific circumstances [closed]

Question
this is not a question but -hopefully- an answer. I realized that more than a couple of people on the WPML forum asked for a solution to this matter, so I thought it could be useful to share my workaround here as I did there. The Issue Let's say that for whatever re
0
conditional-tags, multi-language, plugin-wpml Marks 3 years 0 Answers 75 views

if (is_page(**PAGE ID**)) not working

Question
I'm following this tutorial on adding Google Content Experiments code to header.php. I added the followin
0
conditional-tags Steve 3 years 0 Answers 51 views

Conditional to determine if search.php page is the current template

Question
I have a specific CSS-file for my search results, so the search.php template. I want a PHP if-condition to determine if the current template is the search.php template, so that I can load that CSS-file with wp_enqueue. The condition should work in the functions.php file. I'm n
0
conditional-tags, search, templates ralphsmit 3 years 0 Answers 64 views

WordPress – conditional to determine if search.php page is the current template

Question
I have a specific CSS-file for my search results, so the search.php template. I want a PHP if-condition to determine if the current template is the search.php template, so that I can load that CSS-file with wp_enqueue. I'm not entirely sure if I can use is_search()
0
conditional-tags, search, templates ralphsmit 3 years 0 Answers 68 views
1 2 … 5
  • Recent
  • How to Fix the Error

    If you get an error message “Error Establishing Database Connection,” this means that your website is unable to connect to ...

    May 30, 2021
  • Onitir – IT Solutions WordPress theme

    Onitir - IT Solutions WordPress

    LIVE PREVIEWBUY FOR $29 Onitir is a Modern & ...

    September 18, 2020
  • WhatsApp Chat – WordPress WhatsApp Chat plugin

    WhatsApp Chat - WordPress WhatsApp

    March 19, 2020
  • Tabula – Art, Music & Language School

    Tabula - Art, Music &

    Tabula – Art & Language School WordPress Theme Tabula is a Multi-Purpose WordPress Theme for all kinds of ...

    March 19, 2020
  • Mega Posts Display for Elementor – Premium WordPress Plugin

    Mega Posts Display for Elementor

    Welcome to Mega Posts Display for Elementor. With this awesome plugin for Elementor you can create a posts layout ...

    March 19, 2020
  • Home
  • Ask Question
  • Themes
  • Plugins
  • Tutorials
  • Books

Recent

  • How to Fix the Error

    If you get an error message “Error Establishing Database Connection,” this means ...

  • Onitir – IT Solutions WordPress theme

    Onitir - IT Solutions WordPress

    LIVE PREVIEWBUY ...

  • WhatsApp Chat – WordPress WhatsApp Chat plugin

    WhatsApp Chat - WordPress WhatsApp

Popular Questions

  • 404 error - Page not

    ...

  • How to echo the_excerpt without

    In the code snippet below, I trying to get the_excerpt to be ...

  • How to update meta fields

    I have an app written in Delphi and Indy components for Windows ...

Copyright 2019 WPTricks - WordPress Tips, Tricks and Hacks | Privacy | Terms

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.