RobReg
Forum Replies Created
-
Hello again Drew,
I’ve been playing around with this and realised that it doesn’t quite work as intended. The code when using $_SERVER[‘SCRIPT_NAME’] only returns index.php each time.
I changed it to use this instead:
if (in_array(substr($_SERVER['REQUEST_URI'],1,strpos($_SERVER['REQUEST_URI'],"/",1)), array('continent/','country/'))) { $catDataObj = get_category_by_slug( @$_GET['continent'] ); if ($catDataObj !== false) // check that we have a valid continent value { $cid = $catDataObj->term_id; $filter = array('filter'=>'cats', 'filterDetail'=>'all:' . $cid); $contentDiv = preg_replace('|<li class="erwpFeaturedPhotos".*?data-filterDetail="[^"]*"|', '<li class="erwpFeaturedPhotos" data-filter="' . $filter['filter'] . '" data-filterDetail="' . $filter['filterDetail'] . '"', $contentDiv); } } // Search for dynamic content and replace $contentDiv = self::replaceDynamicRotatorHTML($contentDiv);Just thought I’d share it because someone else might find it useful.
Thanks,
RobHmm, that’s a shame. Did you find another plugin to use or workaround it somehow?
@papamak, did you manage to find any solution to point 2? I’m having the same problem. I really like the Ajax style category selection but I need it to only select the final category chosen and not the top level one + all the child ones.
@specex, was the solution above not what you were looking for?
That’s amazing! Thank you so much for helping me with this.
I might have to add some more ELSEIF hacks for the other pages that I’m working on…I will have a play around with that.
Hopefully this will help others out too, as I’m sure a lot of people must want to only have one page and display a different set of posts depending on a variable passed to it.
Thanks again, Drew.
Rob
Hello Drew,
Great, thank you for the help. I feel like I’m almost there…Apologies for my basic php knowledge, but I’m learning 🙂
Perhaps I could just outline exactly how the flow would work and then it might make more sense.
There is a map on my homepage and a user clicks on the Europe continent. The url that page goes to has a variable passed through in the url, so something like:
“www.mysite.com/continent.php?continent=europe”
When the continent.php page loads, I want it to take that continent=europe parameter and use it dynamically in the slider to show only posts from Europe.
What I’ve done so far…
I’m using this code below to get the category ID from the slug name of the continent (my categories are all of the continents). Not sure if I need to add this to one of the easyrotator files or just ensure that it is added to the page which is being called, continent.php in this EG?
$idObj = get_category_by_slug($continent); $id = $idObj->term_id;So I’m thinking that I need to build up an array in my page continent.php which is then used in the easyrotator function? Something like this:
$temp_array=('filter'=>'tags', 'filterDetail'=>$id)I’m not sure how to build this array!?
I would then add the $temp_array to this function in easyrotator.php
function easyrotator_display_rotator( $rotatorID, $echo=true ) { global $erwp; $content = $erwp->renderRotator($rotatorID,$temp_array); if ($echo) echo($content); return $content; }Then, I would add the same parameter in main.php to line 1170:
public function renderRotator($fullPath,$temp_array)Just before line 1258 in the same main.php file I would add:
$contentDiv = preg_replace('|<li class="erwpFeaturedPhotos".*?data-filterDetail="[^"]*"|', '<li class="erwpFeaturedPhotos" data-filter="' . $temp_array['filter'] . '" data-filterDetail="' . $temp_array['filterDetail'] . '"', $contentDiv);I hope this makes sense and are able to help me over this last hurdle!
Thanks again for your excellent advice,
RobHello @sandor555,
Could you please tell me where you edit the CSS file? Did you find any other helpful documents for editing the style of the posts for WP User Front End?
Thanks,
RobThank you very much for a quick and detailed reply, Drew.
There is just one part I don’t understand:
“then using it to run a replace on $contentDiv immediately before the replaceDynamicRotatorHTML() call on line 1258”
At the moment that line looks like this:
// Search for dynamic content and replace $contentDiv = self::replaceDynamicRotatorHTML($contentDiv);I don’t quite understand what I am supposed to change on that part? Any guidance would be appreciated.
Cheers,
RobHi, this should help you:
Here is what I did to fix this:
open up single.php and find the line:
<?php the_content(); ?>Just above that, or below if you want the image to appear after the content, put this:
<?php if ( has_post_thumbnail()) : the_post_thumbnail('thumbnail'); endif; ?>That should do the trick.
Not sure if this helps but I wanted to get an image on the post when I or someone else was viewing it:
Here is what I did to fix this:
open up single.php and find the line:
<?php the_content(); ?>Just above that, or below if you want the image to appear after the content, put this:
<?php if ( has_post_thumbnail()) : the_post_thumbnail('thumbnail'); endif; ?>That should do the trick.
Here is what I did to fix this:
open up single.php and find the line:
<?php the_content(); ?>Just above that, or below if you want the image to appear after the content, put this:
<?php if ( has_post_thumbnail()) : the_post_thumbnail('thumbnail'); endif; ?>That should do the trick.
@neil0822, I have managed to get this working but not using the plugin. I edited the single.php page to include a call to get the thumbnail and insert it into the post.
Having thought about it, I think that this will mean it will show up in ALL posts, as single.php is used for all of them. I’m not 100% sure, because I’m new to WordPress and PHP, but I’ve got it working. I can post the code if you want it?
Hello,
I have this same problem. When someone adds a post it shows as the thumbnail but I would also like it to be displayed in the contents of the post. Is this possible, does anyone know?
If anyone could help that would be great,
RobForum: Fixing WordPress
In reply to: Categories not showing up in dashboardHi,
Just wanted to add to this in case anyone else was having the same problem and neither of the above solutions worked for them either. I tried them both but it didn’t help.
So, instead, I just used the “search Categories” box to type a letter in there and then any category with that letter should show up, whereas before it was not showing. You can then delete them all and continue doing this until you have got them all.
Cheers,
Rob