The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
9 views

customizing wordpress theme slider with switch statement

i am working on an assignment for wordpress , i need help in following matter, im using wordpress today news theme, the link of my current work ca.unitysofts.com in upper three slider , while ...
0
votes
1answer
9 views

A conditional button

I wish to add a button to a page of my site that redirects the user to the signup page, if he is not a registered user, and to another page of the site, let's say Test_Page, if he is a registered ...
0
votes
1answer
157 views

Conditional required fields for Wordpress Contact Form 7

I know this might be considered off topic but I am not sure where else to post this as it also pertains to WordPress as well as the plugin Contact Form 7. If you know where I should post this other ...
0
votes
2answers
50 views

Widget logic conditional widget

Is there any experience using widget logic, I want to display a widget on single custom post type with specific taxonomy. Tried using is_tax(taxonomy_name) || is_single() && ...
0
votes
1answer
17 views

How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?

I have theme options/settings page and options/settings fields set as outlined here: ...
0
votes
1answer
35 views

Best Method to Switch Between Terms (Custom Taxonomy)

Looking to learn something, here. With the following code, I am loading an external file for each condition based on a known set of custom terms. I'm using has_terms to check for a specific value ...
0
votes
2answers
23 views

Nested conditionals

Got my brain scratching round a wee issue here. In short... If home page, then do nothing if page has a thumbnail then run code that pops the page title on top of full width thumbnail with ...
0
votes
0answers
34 views

jQuery conditions for the wordpress

So, I have two menu items "First Item" and "Second Item" in my menu called . I want to change the title of the each items based on URL. For example, let say you are on the following URL: ...
0
votes
2answers
69 views

If else statement based on referral URL

I am trying to display content in a custom template based on referral URL. I put a link in my footer called http://domain.com/?ref=special and image2.gif shows still when I click it and go to the ...
0
votes
0answers
47 views

Conditional forms with wordpress ajax

I'm creating a wordpress megamenu plugin, i've setup the walker and all frontend things But stuck in the backend i changed some of the walker class <?php /** * /!\ This is a copy of ...
0
votes
1answer
14 views

How to make a hyperlink conditional according to whether you are logged in or not

one of the sections on my home page has a hyperlinked header. I have a multi-user site so I would like that header to take the user to a specific shop category (product-category/aktiviteter/) if they ...
1
vote
1answer
49 views

Show different different menu in theme_location depending on x

I would like to display a different menu in the same theme_location depending on some condition. I'm wondering if this is possible and if so how? I would like to avoid registering an additional ...
0
votes
1answer
30 views

How to display image on condition that a selection has been made

I have a custom post type 'Holidays' and a custom field (created using Advanced Custom Fields) called 'activity_rating'. The activity_rating field is a select dropdown with values 1 to 5. If the ...
0
votes
2answers
15 views

Force Log in to view a page

So I have a page (ex. site.com/start) where I want to show a login page (ex. site.com/start/login) if not logged in, in order to view the page. Without using any plugin, what would be the condition ...
0
votes
1answer
40 views

Check if sidebar is rendered?

I want to check if there are sidebars rendered on the front end and if so output some body classes so I can style the page differently. I tried using is_active_sidebar but that just returns true if ...
4
votes
2answers
106 views

Display several random posts, but make sure a condition is met

I have a custom post type for a group of people (employees). At first, I needed to display 7 random employees. That was easy <?php $args = array( 'post_type' => 'employees', ...
0
votes
1answer
49 views

Issue in If else condition [closed]

I'm calling my all pages on one pages as a section. Here is my code: <?php $args = array( 'post_type' => 'page', 'orderby' => 'ASC', ...
0
votes
0answers
35 views

Theme customiser with conditional logic

Is it possible to use conditional logic within the theme customizer? I would like to display certain options to the end user only if they have selected a checkbox above. Even better, it would be great ...
0
votes
1answer
39 views

Banner appearing on Pages but not Posts; call it conditional confusion

I have a banner image that appears on Pages that I want. However, I also have a Page designated as a Blog where it doesn't appear. Is there any way to have this banner appear on a Page that is using a ...
0
votes
1answer
51 views

How to Conditionally Not Display a Link Based on Current URL?

I have a sidebar with links to 4 guides that I wrote... When users are reading one of my guides I only want to show them the links to the 3 other guides, so no link to the guide they are currently ...
-1
votes
1answer
268 views

Wordpress equivalent to Drupal Views? [closed]

Is there a Wordpress plugin that provides a subset of the functionality found in Drupal Views? Specifically, I'm looking for the ability to use a Views-like plugin to pull in fields of content based ...
0
votes
1answer
46 views

Different titles for static, posts, and every xy page

I have: a static front page "Home" a page with all my posts "My posts" all the other post/pages from the blog "Post x / Page y" and each one of them should display its title in the header. I'm ...
0
votes
0answers
17 views

Whats a good strategy for localising WordPress post and page content?

I'm aware of the various functions for localising elements of themes and plugins - __(), x() and the textdomain concept but how does one go about providing localised versions of actual post and page ...
0
votes
1answer
73 views

is_main_site() Always Returns True

I am using is_main_site() on WordPress Multisite and when I set a break point and view with the debugger it returns true on the primary site and also on a child site I created. Looking at the code I ...
0
votes
0answers
32 views

How to generate custom loop indexes

Besides the regular taxonomies, such as category, tag, author, archive, I also have some special indexes to display, such as list of all sticky posts, simple chronological index of all posts, top ...
7
votes
2answers
1k views

Enqueue Scripts / Styles when shortcode is present

What is the idea way to register/enqueue scripts and/or styles for use in plugins? I recently made a plugin simple plugin to add the user avatar/gravatar with a shortcode. I have different style ...
0
votes
1answer
40 views

Conditional for 404 page not work

I am trying to add a conditional to enqueue script only for 404 page. Theoretically I would have to use is_404() right? Well it does not work: if ( is_page_template('404.php') ) { ...
2
votes
2answers
243 views

different child theme for subdomain

I've got a site that I'm trying figure out how to apply different child themes to based on a subdomain. Applying the child themes shouldn't be difficult, it's more the .htaccess magic that I'm a bit ...
0
votes
1answer
122 views

Allow users to only CREATE one single (custom) post

I created a custom post type with taxonomy and now want to allow users (of a specific user group) to post only one single post in a specific category. If the user has already posted a post, he can ...
0
votes
1answer
41 views

If statement to check for post_content

I'm trying to write an if statement to check for post_content and if there is no post_content then to grab a textarea field content. Below is my code and with this, at this point it's only rendering ...
0
votes
2answers
28 views

If Specific Post, Link Elsewhere

I would like to create a conditional statement that checks the loop for a specific post ID, then if true, it outputs a link elsewhere. This is what I have so far: <?php ...
0
votes
1answer
313 views

Personalized message for each unique password-protected page

How do I provide two different personalized messages for two different password-protected pages? I'm able to personalize the default message using the code below, but I'm not sure how to add a second ...
0
votes
2answers
299 views

If Month=Particular month display content [closed]

I want to use conditional tag to display content according to month. Such as if it is April, it should show something else something else. Right now I am using : <?php if(is_month() == '2' ) : ...
0
votes
1answer
129 views

Give a condition to a wordpress menu item to change its offerid for each landing page I create

So my wordpress site has a one header and one footer with a big CTA as one of the menu items. I want to create a bunch of landing pages but I want to be able to change the offerid in the url for each ...
0
votes
0answers
52 views

Load post conditionally

I am working on a website which displays only 3 posts unless people subscribe for a newsletter. This is done by setting a cookie on validation and inserting this cookie conditionally in my queries. ...
0
votes
2answers
41 views

PHP conditional script issue

I'm have the 2 seperate block of codes as shown below and the one below doesn't work except if I cut off the first one. Any ideas what the problem could be? Conditinal script <?php { ?> ...
0
votes
0answers
35 views

Conditional loop based on current page

I'm trying to get the loop below to display only the post with the category that reflects the given condition but it doesn't seem to work. Any Ideas on how this can be achieved? <?php if ...
1
vote
1answer
176 views

One custom loop with condition to check child posts

I have one loop of pages with 999 page ID as a parent (pages from this loop have also another child pages) $args = array( 'post_type' => 'page', 'post_parent' => 999, 'order' => 'ASC', ...
0
votes
1answer
50 views

Conditional statements based on custom meta value in category archives

Here's what I need to do. Insert a short Javascript in the footer using wp_footer. No problem there for single posts, I have this. add_action( 'wp_footer', 'prefix_wpfooter' ); function ...
0
votes
1answer
36 views

Php conditional help needed

I am trying to add conditionals for authorship to show for posts on a specific author id. Would appreciate if someone could give the following a quick look over <?php if is_author ('2') AND ( ...
1
vote
2answers
85 views

What is the correct way to write this conditional statement?

I'd like to remove auto formatting 'wpautop' from specific pages. Here is what I've got, but it doesn't appear to work: if ( is_page ( 'services' ) ) { remove_filter( 'the_content', 'wpautop' ); ...
1
vote
1answer
62 views

Query posts by content lenght

I am using the code below to pull a random post of my site every 6 hour. if ( false === ( $social_trans_post_id = get_transient( '$social_trans_post_id' ) ) ) { $args = ...
0
votes
1answer
263 views

Help with if else statement for separating content from image attachment

I am currently having some trouble executing the following. I would like to separate the image (wp_get_attachment_image) from the content (get_the_content) by using a conditional statement to display ...
0
votes
1answer
470 views

Get all children page ID's including parent by title

So I am getting all the children ID's as well as the parent ID to show content only for that page and all its sub-pages. This is the following function I created, but was wondering if there is a ...
0
votes
3answers
214 views

Conditionally set post_content in wp_insert_post

Is it possible to conditionally set the post_content in wp_insert_post? Im using a foreach to add multiple pages at once: foreach ($create_pages as $new_page) { $add_pages = array( ...
0
votes
1answer
48 views

Conditional loading of CSS for my plugin

I'd like to continually load the stylesheet needed by my plugin depending on whether a particular shortcode is present on the post or page. The presence of the shortcode would indicate that the user ...
0
votes
2answers
68 views

How to write this conditional statement?

What is the correct way to write a conditional statement? <?php if is_tag( 'Premium' ){ <a href="<?php the_permalink(); ?>" class="info"> ...
0
votes
1answer
28 views

Display WP Start bar on front page only

I was wondering if someone could help me display the plugin WP Start bar only on my static frontpage. If it helps my static frontpage url is: http://zackarylundquist.westhostsite.com/portfolio/
-2
votes
2answers
752 views

Multisite Conditional (if blog_id?) in a page template?

I have a WordPress network with multiple sites using the same theme. Now I need to edit part of a certain PageTemplate.php to display different things based on the blog id. Example: If blog ID 1, ...
0
votes
0answers
125 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...