how to change wordpress onepress service section paragraph value - wordpress

I can not find a way to edit or better say change the "Morbi in sem quis dui placerat ornare. Pellentesque odio nisi euismod in pharetra a ultricies." string.
It is in services section. There is a class called service title for which I set whatever value I have set and inside is a mentioned paragraf.
Have can I change that paragraph so that insted of "Morbi in sem quis dui placerat ornare. Pellentesque odio nisi euismod in pharetra a ultricies.", says line tha I want?
Thank you.

I know it's too late for the answer but not least.
I went through the same issue on wp version 4.9.8 with OnePress and did some customization in a file - /root/wp-content/themes/onepress/section-parts/section-services.php
Replace
<?php the_excerpt(); ?>
To
<?php $moreLink = ' Read more...'; ?>
<?php echo wp_trim_words( get_the_content(), 20, $moreLink ); ?>
Here 20 is the characters limit.

Related

Formatting abstract in a twocolumn article PDF

I'm writing a PDF article using a twocolumn classoption in Quarto and the PDF produced has all content including the abstract laid out in two columns. I'd like the abstract to be displayed across the length of the page without the columns and the remainder of the body be in the two columns. Can anyone help me with how to format this?
The abstract is specified using the default yaml options.
abstract: example abstract text
Reference image
Tried looking at latex templates and copying code over but haven't had any success.
You can solve this problem following this answer on TeX StackExchange and using Latex Partials.
Specifically, you need to use the before-body.tex template partial to write the abstract part inside a twocolumnfalse latex environment. So create the file before-body.tex and add the following,
before-body.tex
$if(has-frontmatter)$
\frontmatter
$endif$
$if(title)$
\makeatletter
\twocolumn[
\maketitle
\begin{#twocolumnfalse}
\begin{abstract}
% Write your abstract here ----------------------------------------------------
\vspace{1em}
Lorem ipsum dolor sit amet consectetur adipiscing elit, urna consequat felis vehicula
class ultricies mollis dictumst, aenean non a in donec nulla. Phasellus ante
pellentesque erat cum risus consequat imperdiet aliquam, integer placerat et
turpis mi eros nec lobortis taciti, vehicula nisl litora tellus ligula porttitor metus.
Vivamus integer non suscipit taciti mus etiam at primis tempor sagittis sit, euismod
libero facilisi aptent elementum felis blandit cursus gravida sociis erat ante, eleifend
lectus nullam dapibus netus feugiat curae curabitur est ad. Massa curae fringilla
porttitor quam sollicitudin iaculis aptent leo ligula euismod dictumst, orci penatibus
mauris eros etiam praesent erat volutpat posuere hac. Metus fringilla nec ullamcorper odio
aliquam lacinia conubia mauris tempor, etiam ultricies proin quisque lectus sociis id
tristique, integer phasellus taciti pretium adipiscing tortor sagittis ligula.
% abstract completed ----------------------------------------------------------
\end{abstract}
\vspace{3em}
\end{#twocolumnfalse}
]
\makeatother
$endif$
Then to add this template, use the template-partials yaml option in the qmd file.
---
title: "Abstract in two column layout"
author: StackOverflow
date: "November 2, 2022"
format:
pdf:
classoption: twocolumn
include-in-header:
text: |
\usepackage{lipsum}
template-partials:
- before-body.tex
---
## Quarto
\lipsum
Note that, create the partial file named exactly as before-body.tex, since per the documentation,
Note that the name of the partial files is important. You choose which portion of the template to replace by providing a partial with that name.
And I have used the latex package lipsum just to generate Lorem Ipsum text, otherwise it's not related to the problem in question.

Why Quarto TOC is not recoqnising markdown headers?

I'm trying to programm content of the HTML quarto document. I.e. I have several functions which return a Markdown/HTML content. The markdown itself renders OK, however the quarto's table of contents(TOC) does not recognise the headers!
For example, this document has several headers. First was rendered using shiny::markdown(), second with the help of shiny::HTML() while the third one was written in a plain markdown. The quarto's TOC rendered only the lastone. Is there a possibility to include programmatically written headers in the TOC?
The code itself:
---
title: "Test"
toc: true
format: html
---
```{r, echo = FALSE}
library(shiny)
foo_md <- function(){
shiny::markdown("## Header generated with foo_md()")
}
foo_html <- function(){
shiny::HTML("<h2> Header generated with foo_html() </h2>")
}
```
```{r, echo = FALSE}
# First header
foo_md()
```
Lorem ipsum dolor sit amet, in at in sed nibh. Neque dignissim
ad imperdiet urna urna. In id erat aliquam, dolor ut odio.
Congue at, non justo fermentum urna suscipit ad torquent posuere.
```{r, echo = FALSE}
# Second header
foo_html()
```
Suspendisse ad sed, amet nec nunc conubia faucibus. Sociis in
pellentesque nibh. Venenatis at ut imperdiet ornare lectus diam ex
vitae. Id, aenean turpis diam, eget a justo consectetur finibus
mauris.Vehicula viverra sed volutpat metus placerat tellus non.
Et nisl. Et duis vel in.
## Ordinary markdown header
Vehicula viverra sed volutpat metus placerat tellus non. Et nisl. Et duis vel in.
I'm using Windows machine with quarto version 1.0.38
To include programmatically written headers in TOC, one option is to create that header with paste (or with paste0), then simply cat it with chunk option results=asis. Then pandoc filters for quarto will render this header in output HTML document with proper id and class so that TOC can target it.
---
title: "Test"
toc: true
format: html
---
```{r, echo = FALSE}
foo_md <- function(){
x <- "Quarto Header"
y <- "dynamically generated"
header <- paste("## ",x, y, "with foo_md()")
cat(header)
}
```
```{r, echo = FALSE, results='asis'}
# First header
foo_md()
```
Lorem ipsum dolor sit amet, in at in sed nibh. Neque dignissim ad
imperdiet urna urna. In id erat aliquam, dolor ut odio. Congue at,
non justo fermentum urna suscipit ad torquent posuere.
## Ordinary markdown header
Vehicula viverra sed volutpat metus placerat tellus non. Et nisl. Et duis vel in
The rendered document look like this,
But when we create them with shiny::HTML or shiny::markdown, they are not rendered in the HTML document with the necessary id or tag and TOC can not target them. They are simply rendered as h2 and we could see them as level2 header in our documnet but not in the TOC.

WordPress adds paragraphs around shortcode

I'm trying to create an enclosing shortcode that should be inline with regular text. So I would like to use it like this:
Vestibulum ac diam sit amet quam vehicula [caption]elementum sed sit amet dui[/caption]. Proin eget tortor risus. Vivamus suscipit tortor eget felis porttitor volutpat.
When doing this and saving the post, WordPress will automatically wrap paragraph tags around the shortcode. Like this:
<p>Vestibulum ac diam sit amet quam vehicula</p><p>[caption]elementum sed sit amet dui[/caption]</p><p>. Proin eget tortor risus. Vivamus suscipit tortor eget felis porttitor volutpat. </p>
What's the best way to disable this behaviour? Multiple people suggested moving the wp_autop filter to after the execution of the shortcode, but I believe this will only work for content in the shortcode, not for the wrapping of the shortcode itself.
Also, there's the shortcode_unautop function that should stop WordPress from wrapping the shortcodes, but I'm not sure if it works right, at least I can't seem to get it to work.
My shortcode now looks like this:
function caption_shortcode( $atts, $content = null ) {
return '<span class="caption">' . $content . '</span>';
}
add_shortcode( 'caption', 'caption_shortcode' );
You can use shortcode_unautop() function. For details check here.
Try like this:
function caption_shortcode( $atts, $content = null ) {
return '<span class="caption">' . shortcode_unautop($content) . '</span>';
}
add_shortcode( 'caption', 'caption_shortcode' );

wordpress plugin different content on different pages

Can you please help me with following? I am building plugin that will based on different pages show different content.
For example, on page1 there will be one content, on page2 other, and on all other the content will stay as it was.
Here is my plugin code (I take content and change it for specific pages only):
$content = get_the_content();
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
wp_enqueue_script('ajax_bill', '/wp-content/plugins/ed-merna-mesta/js/ajax_bill.js');
wp_enqueue_style('styles', '/wp-content/plugins/ed-merna-mesta/css/styles.css');
include_once("php/functions.php");
include_once("php/functions_helper.php");
add_filter('the_content','get_plugin_page_content', $content);
function get_plugin_page_content($content) {
if (is_page('page1')) {
get_accounts_list();
}
else if (is_page('page2'))
{
last_account_bill();
}
else
echo $content;
}
Problem is that home page show something like (I have some random text):
[one_third]
A lot of fonts included
[icon_pencil]Quisque convallis orci ut lacus sed imperdiet eget lobortis dolor tellus pharetra. In hac dolor habitasse platea dictumst. Integer sedelor risus sit mi ligula. Lorem ipsum dolor sit amet platea in distumst. Quisque convallis orci ut lacus sed imperdiet eget lobortis dolor tellus pharetra. [button url="#"]Read more...[/button] [/one_third] [one_third]
There is some problem with showing the content!
When I comment line:
add_filter('the_content','get_plugin_page_content', $content);
everything is OK on home page (plugin not showing anything of course).
I am using clear-theme.
Where am I going wrong???
Thank you.
if anyone stumbles to same problem, I figured it out:
I needed:
do_shortcode( $content );

Drupal JQuery UI Draggable / Stacking Divs

I'm trying to get the jquery draggable function to work, particularly the stacking feature, in Drupal. I've got the JQuery UI module installed and it works fine with a hide/reveal sliding box but not for the draggable?
Here's what I've got in the body of my page:
<?php
drupal_add_js('
$(document).ready(function drag() {
$(".cc-drag").draggable();
});','inline');
?>
<div class="cc-drag">
<div class="cc_top">
<div class="cc_content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque elit dolor, ornare non vulputate quis, dictum ut neque.
Nunc non velit at nulla posuere pulvinar. Maecenas vitae diam iaculis lorem sagittis condimentum et at elit.
Praesent ac augue dolor.
Sed sit amet orci leo, vitae sagittis ante.
Phasellus id volutpat nibh.
Nam ullamcorper mi at urna cursus vitae aliquet est ullamcorper.
</div>
</div>
<div class="cc_bottom"></div>
</div>
I'm using Drupal 6.x on WAMP.
Thanks!
In Drupal 7, where jQuery UI is in core:
drupal_add_library('system', 'ui.draggable');
See http://drupal.org/node/1001508
In Drupal 6:
jquery_ui_add(array('ui.draggable'));
This is the preferred method:
jquery_ui_add(array('ui.draggable', 'ui.resizable', 'ui.dialog'));
Just place that in your module's hook_init() function.
For some reason the js files weren't loading, or not loading fully, so I copied the ones I needed to my theme folder and linked to them in my .info file.
scripts[] = js/jquery.ui.widget.js
scripts[] = js/jquery.ui.mouse.js
scripts[] = js/jquery.ui.core.js
scripts[] = js/jquery.ui.draggable.js
The order they are loaded is important. I found many many other threads and forums where other people have been having the same problem in the last 1-4 months. Hope this helps someone else. The js console in firebug was really helpful in getting to the root of the errors, if anyone needs to explore their own problem further.

Resources