Questions tagged [switch]

The tag has no usage guidance.

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
40 views

get post id by $content (so by post content)

So weird, huh? But, not joke --> I try to be very clean of being: I have a subdomain based multisite network. If the users posts to their sites, I get a clone from the current post to my network home. ...
1
vote
0answers
45 views

Login Redirect - Multiple Scenarios

I'm trying to create some code that will accomplish the following: If login from any page in this array(example-page-one, example-page-two, example-page-three){ then, simply refresh the page } elseif ...
1
vote
1answer
1k views

How can I allow access to two user accounts using one login?

I have spent the last two hours searching for this and I cannot find a solution to my problem. I have a WP site with WooCommerce running which allows to users to create their own store. My client ...
0
votes
1answer
25 views

change template with button

I created plugin with code : function fxn($theme) { if(isset($_POST['zmien'])){ $theme = 'loose';} else{ $theme = 'twentytwenty';} return $theme; } add_filter('template', 'fxn'); ...
0
votes
0answers
12 views

Post type switch on front by post author

It's really nice to write first post here ;) Ok, let's get started. I have 2 custom post types - 'actual' and 'finished'. On 'single-actual' i want to have a link that when author post click then ...
0
votes
0answers
25 views

What structure should I chose for my website?

I have website with local events and news in our city. There are different categories - one for each of event organizers. Right now I need to add support for other city - so that user can select one ...
0
votes
2answers
346 views

Using Switch Statement to Change Image According to Last Digit of Topic ID

I am trying to build a function, which gives out different image-urls, according to the last digit of bbp_get_topic_id(). This is, what i've got so far: function bg_image_topic_titlearea() { $...
0
votes
2answers
45 views

How to switch between two forms for visitor once admin logged in?

I have two forms (form1 and form2). Once the admin is logged in anywhere, all visitors (not logged in) to my WordPress site should see form1 on the page, otherwise they should see form2. I am using ...
0
votes
1answer
128 views

Subcategory IDs in relation to parent category ID switch case

I would like to switch ads tags in my footer depending on which category it displays at the moment. Code from below works fine for custom category pages and category pages that are included in the ...
0
votes
1answer
185 views

How to switch subdomain with root domain and redirect traffic?

I want to move subdomain to root, and create a new root. I have root.com. I want to move it to sub.root.com and install a new Wordpress intall at root.com. Any idea how I redirect the traffic from ...
0
votes
0answers
45 views

Wordpress templates bug

I have a WP problem that's driving me crazy. I have created several templates, and it decides to switch them all the time... I think it does when I create a new template file, but it never did that ...
-2
votes
0answers
18 views

switch_theme problem with permanent change during the session

I would like to use switch_theme to change the template on the site with the button. It works but only until I click on any other place on the page because then the page returns to the previous ...