Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Famke__

    (@famke_)

    I figured out it has nothing to do with the older version of WordPress. I also fixed the jQuey, but the other problems remain.

    Thread Starter Famke__

    (@famke_)

    I’m thinking these problems might exist because the website I’m supposed to install the theme in is an old version. They use WordPress 4.2.5. Could this be it? I’d rather not go around updating their site when I don’t know if it will fix the problem.

    Thread Starter Famke__

    (@famke_)

    So I was supposed to get mail if there were any replies, but didn’t get any…

    Anyway, it turned out the problem was that I loaded Javascript through functions.php, and with that overwrote the Javascript for the slider. So it’s fixed now!

    Thread Starter Famke__

    (@famke_)

    I decided to try to just add CSS to the table itself, which works. Still, I don’t know how to add CSS to the tableitem that I clicked, and give that item an opacity of 1.0.

    Thread Starter Famke__

    (@famke_)

    I’m running the website on localhost, so I can’t do that unless I add a screenshot or such.

    Thread Starter Famke__

    (@famke_)

    Thanks! It doesn’t seem to work, though.

    Also, this code:
    jQuery(this).removeClass('home_tableEerste');
    is supposed to be:
    jQuery(this).removeClass('opacity');

    That’s how I intended it at least. I guess I changed it to “home_tableEerste” because I was trying to the problem.

    Still doesn’t work with the opacityclass and without the dot though.

    Thread Starter Famke__

    (@famke_)

    I copypasted your code and then decided to replace $cat_name with the actual category_name, and that worked. This is exactly what I was trying to do in the first place, so thanks! 🙂

    Thread Starter Famke__

    (@famke_)

    Thank you so much for the quick responds and help!

    The get_posts you send, is that a line of code I put in instead of these lines?

    query_posts('category_name=zoekennaar' . $cat_name);
    $content = get_post_field('post_content', $cat_name);

    To be honest, I don’t have much an idea of what I’m doing. I’m totally new to this and someone explained this to me, so I thought I’d give it a shot.

    First of, my website needs to be editable by my boss, without her having to dig into PHP files.

    I’m basically trying to generate a list from a post. This list offers the users four options. The user can click one of those options, and another list of options will apear.

    Every list is a new post with a new category name. As said above, my boss needs to be able to add to or take things away from the list, without having to go into php.

    Thread Starter Famke__

    (@famke_)

    Actually, I thought I defined $cat_name in the first line of the code: figured the string of $cat_name would now be the category name I gave it. Apparently that’s not true, the output of var_dump gives me ‘null’.

    I initially wrote this code with a post_id instead of category_name, but I’m making this for someone who needs to be able to make changes. Therefore, I need category_name rather than post_id. With post_id it worked like this, no errors whatsoever:

    <?php
    	$postid = 33;
    	$content = get_post_field('post_content', $postid);
    	$content = explode('|', $content);
    		foreach ($content as &$zoekenNaar)	{
    		$zoekenNaar = explode(':',$zoekenNaar);
    			echo '<pre>';
    			print_r($zoekenNaar);
    			echo '</pre>';
    		}
    ?>

    I have tried just changing it like that, adding $category_name = 'zoekennaar', but it doesn’t work.

    (I’ve added brackets to the foreach loop as you can see, forget that in the first place, and added print_r $zoekenNaar instead of $content now, which is what should be happening).

    ADDED:

    I created a new post to see what would happen. My code as it is now shows the most recent post, so $cat_name indeed doesn’t work. Figured most of you already know, but I’m not the only newbie so it might be useful for someone 🙂

    Thread Starter Famke__

    (@famke_)

    Thanks, I’ll look into that soon! 🙂

    Thread Starter Famke__

    (@famke_)

    I seem to have been able to fix the problem myself after all. It’s really simple (as I expected), just copypaste this code:

    <?php recent = new WP_Query('page_id');
    if ($recent->have_posts()) : $recent->query_posts(); ?>
    	<h2>
    		<?php the_title(); ?></a>
    	</h2>
    	<?php the_content(); ?>
    	<?php else: " " ?>
    	<?php endif; ?>

    Most of this code came from here: https://wordpress.org/support/topic/how-to-display-a-specific-page?replies=3 , I made some small changes to make it work for me.

    Thread Starter Famke__

    (@famke_)

    Thanks for the quick response!

    Adding everything directly into WordPress sounds easier and better for my client, as they’ll need to update things and put in new files. However, I need to be able to show “the right documents at the right time”. Users need to be able to filter, so they’ll go to Manuals, then choose a subcategory and another subcategory. Is it possible to implement this if I put into WordPress directly? And is it easier than to use $wpdb?

Viewing 12 replies - 1 through 12 (of 12 total)