Phillip
Forum Replies Created
-
Forum: Plugins
In reply to: Limit words displayed in $contentHi Alchymyth,
I managed to use the trim-words function and add html around it to achieve what i needed. Thank you very much.
<?php $page_id = 89; $page_data = get_page( $page_id ); $thumbnail = get_the_post_thumbnail( $page_id, $size, $attr ); $title = $page_data->post_title; $content = $page_data->post_content; $trimmed_content = wp_trim_words( $content, 20 ); echo '<div class="thumbnail">' . $thumbnail . '</div>'; echo '<div id="slidecontent">'; echo '<h5>' . $title . '</h5>'; echo '<p>' . $trimmed_content . '</p>'; echo '<a class="slidemore" href="'. get_permalink($page_id) . '">MORE</a>'; echo '</div>'; ?>
Only problem now is that this pulls through the headings written on each page. An example of this is at: https://upg.phillipvale.com.au/
In the mining slide that you can see in the top left corner. I don’t want to display the text “THIS IS THE MINING HEADING.”
I was previously hiding this with css and display=none; Is there a way to start the trim_words from the fullstop in the heading?Confusing, but I thought I would just ask. ??
Thank you,
Phil
Forum: Plugins
In reply to: Limit words displayed in $contentHi alchymyth,
I looked at the page above. Thank you for your help.
Although this strips out all of the html tags. Is there a way to keep the html styling and still limit the content? I just need the <h3> and <h4> tags to still work on the static page.
<?php $page_id = 89; $page_data = get_page( $page_id ); $title = $page_data->post_title; $content = $page_data->post_content; echo '<h5>' . $title . '</h5>'; $trimmed_content = wp_trim_words( $content, 40, '<a href="'. get_permalink() .'"> ...Read More</a>' ); echo $trimmed_content; ?>
Thank you,
Phil Vale
Hi there,
Desperate to fix this! Please help!
The site has been working perfectly but now variable product is disabling the AJAX animation that reveals the Add to Cart once size is selected.
The site is: https://mattillidge.phillipvale.com.au/
Any help would be much appreciated,
Phil
Forum: Fixing WordPress
In reply to: Menu linksEPIC FAIL…
The URL settings in Dashboard>General were referencing https://phillipvale.com/roostersfootballclub.
Sorry for wasting everyones time. ??
Phillustration
Forum: Fixing WordPress
In reply to: Menu linksHi,
The site https://www.epjru.com.au/ seems to work fine.
But when I click through on the Side menu it reverts back to https://www.phillipvale.com/roostersfootballclub/
epjru.com.au is an addon domain to my server and phillipvale.com is the primary domain.
Please help me guys! This client is getting cranky!
Thanks,
Phillustration
Forum: Fixing WordPress
In reply to: Menu linksHi again,
Should I change https://phillipvale.com to be in it’s own directory?
Thanks,
Phillustration
Forum: Fixing WordPress
In reply to: Menu linksHi Nasir Zia,
Thanks for the help. No, I don’t think these would be considered custom links. These are just menu items created in the dashboard when the user creates pages.
Thanks,
Phillustration.
Forum: Fixing WordPress
In reply to: Page nameshi james.
thank you! worked a treat.
Forum: Fixing WordPress
In reply to: Read more not working on pages displayed on home pageForum: Fixing WordPress
In reply to: Read more not working on pages displayed on home pageHi Reuben,
Thanks for that. Unfortunately all that this has done is format the text properly.
Before it was all a continuous line of text, now it is using paragraphs.
I am really stuck on this one!
This is what my code looks like now:
<h2 class="entry-title"> <a href="https://www.phillipvale.com/?page_id=4"> <?php $page_id = 4; $page_data = get_page( $page_id ); $title = $page_data->post_title; echo $page_data->post_title; ?> </a> </h2> <?php $page_id = 4; $page_data = get_page( $page_id ); $the_content = apply_filters('the_content',$page_data->post_content); echo $the_content; ?>
Thanks again.
Forum: Fixing WordPress
In reply to: Read more not working on pages displayed on home pageThanks for you help vtxyzzy.
However, it still doesn’t seem to be working.
I have pasted the code as it looks now below, i’m not sure if i’m doing something wrong?
<h2 class="entry-title"> <a href="https://www.phillipvale.com/?page_id=2"> <?php $page_id = 2; $page_data = get_page( $page_id ); $title = $page_data->post_title; echo $page_data->post_title; ?> </a> </h2> <?php global $more; $more = 0; ?> <?php $page_id = 2; $page_data = get_page( $page_id ); $the_content = apply_filters('the_content',$page_data->post_content); echo $page_data->post_content; ?>
Is there anywhere else on the site that i need to clarify $the_content ?
Thanks for you help again.
Forum: Fixing WordPress
In reply to: Read more not working on pagesHi esmi,
Thanks for this link, I’m afraid I am still confused though.
The Codex page says to add the code:
<?php global $more; $more = 0; ?>
Before the content tag:
<?php the_content('Continue Reading'); ?>
Forgive, but will this appear like this?
<?php global $more; $more = 0; ?> <?php $page_id = 2; $page_data = get_page( $page_id ); $title = $page_data->post_title; echo $page_data->post_title; ?> <?php $page_id = 2; $page_data = get_page( $page_id ); $content = $page_data->post_content; echo $page_data->post_content; ?>
Hi Imcgowan,
First time I have tried to help someone on this so bare with me.
To set pages as a static page:
1. Create the page that you want to have as a static page e.g. home
2. Select Settings -> Reading
a. Select the Static page option
b. Choose the page that you want as your static page
c. Choose the page that you want as your blog pageHope that helps. ??
Fantastic! Thanks ambrosite.
Works a treat! I wish I had thought to use the forum sooner….